La mayoría de los sitios web agregan un icono o un logotipo de imagen en la barra de título. El logotipo del icono también se denomina favicon. Agregar favicons también se considera bueno para el SEO de los sitios web. El favicon es la combinación del icono favorito.
El atributo de enlace se utiliza para agregar el favicon.
Sintaxis:
<link rel="icon" href="icon_path" type="image/icon type">
Ejemplo:
<!-- HTML code to add icon in the title bar --> <!DOCTYPE html> <html> <head> <meta charset = "utf-8" /> <title> GeeksforGeeks icon </title> <!-- add icon link --> <link rel = "icon" href = "https://media.geeksforgeeks.org/wp-content/cdn-uploads/gfg_200X200.png" type = "image/x-icon"> </head> <body> <h1 style = "color:green;"> GeeksforGeeks </h1> <p> GeeksforGeeks icon added in the title bar </p> </body> </html>
Producción: