Trends

How to add a browser tab icon (favicon) for a website ?

Trending 1 year ago
beritaja.com

Improve Article

Save Article

Improve Article

Save Article

A browser tab icon, besides known arsenic a favicon is simply a mini image that appears earlier nan title of a webpage successful nan browser tab aliases bookmark barroom to correspond a website. It helps successful marque recognition, improves personification experience, and makes nan website guidelines retired among others. Adding a favicon tin thief users easy place your website and differentiate it from different unfastened tabs.  

In this article, we will talk really to adhd a favicon to a website utilizing HTML. A favicon is simply a mini image that is ever displayed adjacent to nan page title successful nan browser tab.

rajneeshshukla.com

The portion which is highlighted pinch yellowish colour shows nan favicon aliases browser icon. The mini GeeksforGeeks image shown successful nan tab is nan favicon we are talking about.

To adhd a favicon to a website, you request to create an icon record successful .ico aliases .png format, and past reference it successful nan HTML code:

Approach: Use an existing icon: If you person an existing icon successful .ico, .png, aliases .gif format, you tin usage it arsenic a favicon. To usage an existing icon arsenic a favicon, adhd nan pursuing codification to nan caput conception of your HTML document:

<link rel="icon" type="image/png" href="path-to-favicon">

HTML

<!DOCTYPE html>

<html>

<head>

    <meta charset="utf-8" />

    <title>

        GeeksforGeeks

    </title>

    <link rel="icon" href=

          type="image/x-icon">

</head>

<body>

    <h1 style="color:green;">

        GeeksforGeeks

    </h1>

    <p>

        Welcome to my website

    </p>

</body>

</html>

Explanation:

  • <link>: This tag is utilized to nexus to outer resources for illustration stylesheets and favicons.
  • rel=”icon”: This property indicates that nan nexus points to a favicon.
  • type=”image/png”: This property specifies nan MIME type of nan file, which successful this lawsuit is an icon.
  • href=”https://media.geeksforgeeks.org/wp-content/cdn-uploads/gfg_200X200.png”: This property points to nan location of nan icon file. The filename and hold tin beryllium changed arsenic needed.

Output:

Editor: Naga



Read other contents from Beritaja.com at
More Source
close