Forum Moderators: not2easy

Message Too Old, No Replies

Changing favicon using css?

         

edward301

2:30 am on Jun 5, 2005 (gmt 0)

10+ Year Member



My website has three colours red, green and blue these are different style sheets switched using javascript.

I would like to specify a different favorite icon for each style.

So the red style sheet for example would load a red favicon.

tedster

3:16 am on Jun 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Neat idea...but....

As far as I know favicon files are not exposed to css code in any way. They were created for favorites or bookmarking (hence the name) which is not directly involved with page rendering. Newer browsers like Opera and Firefox have been using the favicon in other ways (address bar, tabs) but it's still not part of the page rendering itself, and it's not an html element.

kaled

10:57 am on Jun 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If the stylesheets were switched server-side, there might be a way to do it but the reward would not justify the effort.

Kaled.

edward301

11:13 am on Jun 5, 2005 (gmt 0)

10+ Year Member



Thank you for the feedback i think im going to use a bit of simple php to detect the selected style sheet and display the alternative favicon that way.