I would like to know if it is necessary for me to specify it like this:
<link rel="icon" href="[URL]" type="image/x-icon" />
<link rel="shortcut icon" href="[URL]" type="image/x-icon" />
or can I just include it in the root and the browser will look for it?
Also what's the difference between rel="icon"
and rel="shortcut"
?
All browsers will simply check for a (favicon. ico) file at the root level of your website. Shortcut is simply a workaround to designate an icon that is not named favicon.
Nowadays, favicons are displayed right above the address bar regardless of whether the website is bookmarked or not. And in the small chance that a website doesn't have a favicon, the browser will display a generic browser symbol. 2. In addition to the address bar, favicons can also be found in the browser history.
A favicon can actually be either a PNG, GIF, or ICO file. However, ICO files are typically used more than others as the file size is smaller and it is supported in all major browsers. PNGs are used more commonly for IOS, Android, and Windows 10 devices.
All of the major five browsers look in the site's root for a file named exactly favicon.ico
, regardless of type, automatically.
You can override this with a link
element with rel="icon"
, or rel="shortcut icon"
. The latter is supported by every browser, while the former is more correct, but not recognised by Internet Explorer.
Most browsers these days will look for a favicon.ico
file on the root of the site.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With