How do I put my website's logo to be the icon image in browser tabs?

HtmlFavicon

Html Problem Overview


The image next to the page title in the browser tab - how can you link an image here?

Html Solutions


Solution 1 - Html

That image is called 'favicon' and it's a small square shaped .ico file, which is the standard file type for favicons. You could use .png or .gif too, but you should follow the standard for better compatibility.

To set one for your website you should:

  1. Make a square image of your logo (preferably 32x32 or 16x16 pixels, as far as I know there's no max size*), and transform it into an .ico file. You can do this on Gimp, Photoshop (with help of a plugin) or a website like Favicon.cc or RealFaviconGenerator.

  2. Then, you have two ways of setting it up:

A) Placing it on the root folder/directory of your website (next to index.html) with the name favicon.ico.

or

B) Link to it between the <head></head> tags of every .html file on your site, like this:

    <head>
      <link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
    </head>

If you want to see the favicon from any website, just write www.url.com/favicon.ico and you'll (probably) see it. Stackoverflow's favicon is 16x16 pixels and Wikipedia is 32x32.

*: There's even a browser problem with no filesize limit. You could easily crash a browser with an exceedingly large favicon, more info here

Solution 2 - Html

It is called 'favicon' and you need to add below code to the header section of your website.

Simply add this to the <head> section.

<link rel="icon" href="/your_path_to_image/favicon.jpg">

Solution 3 - Html

This is the favicon and is explained in the link.

e.g. from W3C

  <link rel="icon" 
     type="image/png" 
     href="http://example.com/myicon.png">

Plus, of course the image file in the appropriate place.

Solution 4 - Html

Add a icon file named "favicon.ico" to the root of your website.

Solution 5 - Html

<link rel="apple-touch-icon" sizes="114x114" href="${resource(dir: 'images', file: 
'apple-touch-icon-retina.png')}">

or you can use this one

<link rel="shortcut icon" sizes="114x114" href="${resource(dir: 'images', file: 'favicon.ico')}"
type="image/x-icon">

Solution 6 - Html

  1. ADD THIS
**<HEAD>**

  < link rel="icon" href="directory/image.png">

Then run and enjoy it

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionjayView Question on Stackoverflow
Solution 1 - HtmlLasagnaAndroidView Answer on Stackoverflow
Solution 2 - HtmlDulacosteView Answer on Stackoverflow
Solution 3 - HtmlVincent RamdhanieView Answer on Stackoverflow
Solution 4 - HtmlMike FultonView Answer on Stackoverflow
Solution 5 - Htmluser3680001View Answer on Stackoverflow
Solution 6 - HtmlMuji TechView Answer on Stackoverflow