Favicon not showing

I have a website where I am trying to make an icon. The only problem is that it does not appear. On my local host, it just shows a cloud thing, and on a page it opens with an html file, it just shows a normal white page on all sites without an icon.

This is how I try to implement it.

<link rel="icon" type="image/icon" href="http://www.mywebsite.com/myfavicon.ico"/>

<link rel="stylesheet" type="text/css" href="mainColorTest.css" />

+4
source share
4 answers

I do this without writing a single line of code and always works.

just make sure the file format is png and that is for sure 16X16 pixels. then rename it exactly to 'favicon.ico'and put it in the root directory of your site.

, . ctrl+F5 , ( )

+1

, favicon.ico URL , .. http://www.mywebsite.com/favicon.ico - , . html, .

+1

favicon rel- "icon" , ; . HTML 4.01 , URI http://example.com/myicon.png :

<!DOCTYPE html 
      PUBLIC "-//W3C//DTD HTML 4.01//EN"
      "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
<head profile="http://www.w3.org/2005/10/profile">
<link rel="icon" 
      type="image/png" 
      href="http://example.com/myicon.png">
[…]
</head>
[…]
</html>

XHTML 1.0 :

<!DOCTYPE html 
      PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html
      xmlns="http://www.w3.org/1999/xhtml" 
      xml:lang="en-US"
      lang="en-US">
<head profile="http://www.w3.org/2005/10/profile">
<link rel="icon" 
      type="image/png" 
      href="/somewhere/myicon.png" />
[…]
</head>
[…]
</html>

HTML 5... :

favicon.ico - , HTML ... :

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

YOUR_PATH - -

Add this HTML snippet between ... page tags. The entire image file is already included in the HTML. No need to download favicon.ico file. This works in all browsers except Internet Explorer.

<link href="data:image/x-icon;base64,AAABAAEAEBAAAAAAAABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAAy8vLAAEDAAAROkkABAAAAAACBgAFAwAAIVJsALOliAAFAwkAT/T3AJTK/wAcTewAsOzvAB5I7wAfTuYA0LeiAHr6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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAqDFyiQAqB3M+X06IJBlaqKg8XooAoaaNyrASXW2ST6gxAYpeAIM1Hpl5DH6rMFDOqM6zvQC+0lnDh8wYJ2XRZ6jOMaitxLi/YH27a4sipJOoqIZxrVgQf56sSs0ckA+Tzm6bdEI7OMu1pVaxP1MbkzeTfENkUZUoEy8WHWbPopMJp0jHtrkLgrIzqQ52d5cfVzaTugCdFWhNFy1jJWmBAMg9xiMAr4AhVZxBwFSfRs5bqJTCdbcDSQpLFBooeryo0ECgKxHBOqoyNClMLHAAqJFhb5p4j5YIhMlcewJHDa2t01IgtI7Fxa6uRAaFLoytqAWjYiZsbGpqmASoOUUAqAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" rel="icon" type="image/x-icon" />
0
source

Keep something like this "favicon.ico"Browsers are smart and they will load your icon without mentioning the URL.

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

Delete the cache or use CTRL + F5 to refresh the page without a cache.

0
source

All Articles