Reputation: 17530
Is there anyway to add favicon [GIF & ICO]
through CSS or I need to add the tag in every HTML pages ?
Upvotes: 2
Views: 1167
Reputation: 11
An html tag is a reliable way to achieve this effect. Of note, the current auto-generated tags from favicon.io have broken end tags, so you will need to fill them in. Additionally, I recommend adding an additional line to include the href for the favicon.ico file that they auto generate for you as well.
snip of favicon website as of 30JAN24
Upvotes: 1
Reputation: 129848
The favicon can not be defined in CSS. If you want reliable behaviour, you should use the HTML tags.
Browsers will usually automatically look at /favicon.ico
if an icon isn't defined in HTML. Putting an .ico
file here will work in all browsers, but this won't work for other file types.
Upvotes: 5
Reputation: 46328
I am not sure about having the Icon in CSS but if you put the icon in the root folder of your site browsers will show the icon correctly. (As A ICO Format)
This has good information here http://en.wikipedia.org/wiki/Favicon
Upvotes: 2