2

Is there anyway to add favicon [GIF & ICO] through CSS or I need to add the tag in every HTML pages ?

1
  • 1
    every HTML page: unstructured application Commented Jul 19, 2011 at 6:30

3 Answers 3

5

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.

Sign up to request clarification or add additional context in comments.

2 Comments

anything possible with .htaccess ?
"'must use HTML' means 'must use HTML'"
2

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

1 Comment

Personally I would stick to ICO format because gif is not supported in Internet Explorer according to this article I listed in the above answer.
1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.