![set icon html javascript set icon html javascript](https://constructs.stampede-design.com/wp-content/uploads/2017/01/javascriptlogo-2.jpg)
File extensions don’t really matter on the web. Note that this works even for icons that are not in the ICO format! Browsers that support SVG favicons look for /favicon.ico all the same, and nothing stops you from serving an SVG resource with Content-Type: image/svg+xml at that URL. Firefox does it the other way around: it has a entry in about:config which can be set to false to disable this behavior, but the default value is true.) (SeaMonkey does offer an “aggressively look for website icons when the page does not define one” setting, though, but it’s disabled by default.
![set icon html javascript set icon html javascript](https://c8.alamy.com/comp/2B1M0XG/cute-forest-icons-scandinavian-watercolor-symbols-woodland-decoration-illustration-forest-wildlife-set-graphics-2B1M0XG.jpg)
The only browser that currently doesn’t do this is SeaMonkey. Not having a favicon.ico file in your root will cause a lot of 404 errors.Īlmost all modern browsers look up /favicon.ico by default: Opera, Safari, Chrome, Firefox, Internet Explorer 5+. And if you omit the entire link rel="icon" declaration, other browsers will go looking for that file as well. This way, Internet Explorer will detect it, regardless of whether you’re specifying it in a link element or not. Just make sure to always put the favicon in the root directory of your site, and name it favicon.ico. Needless to say, this still sucks - all the more reason to just name the icon favicon.ico and place it in the root of your domain. Update: If the Release Candidate is any indication, IE9 won’t doesn’t require the shortcut link relation anymore if you specify type="image/x-icon". Using rel="icon shortcut" won’t work in IE either, since it doesn’t treat the rel attribute as a space-separated list. In fact, almost every browser does that when there’s no link rel="icon" specified. If the shortcut value is omitted from the rel attribute, Internet Explorer ≤ 8 ignores the declaration entirely, searches for a file called favicon.ico in the site root, and uses that instead. So, do we have to use the shortcut relation to support IE? Not at all. Without IE, rel="icon" would suffice to specify a favicon. It is, in fact, proprietary to Internet Explorer. Indeed, it doesn’t show up in section 4.12.5 of the HTML5 specification on ‘link types’. Today, I learned that shortcut is not a valid link relation. Looks okay, right? Guess what - it isn’t! Most sites use the following HTML to specify a favicon: