Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crazy Favicon code 2

Status
Not open for further replies.

Voidshape

Technical User
May 1, 2007
5
US
I'm a Golive 6 user, and up frot will say that I am NOT a programmer. I'm a graphic designer who also runs a website. Golive has been great, but I couldn't find a specific tool for favicon creation, so I started looking at other sites' code.

Right off the bat I could see that some sites had favicons that only displayd in some browsers. IE seems problematic, Firefox seems cooperative.

After much cuting, pasting, uploading, and comparing, I've got this mess in my <head> area:

<href="/favicon.ico" type="image/x-icon" /><link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href=" type="image/vnd.microsoft.icon" />
<link rel="shortcut icon"
href=" type="image/x-icon" />

It's code culled from three differnet sites addapted with my site's url. It seems to be working, but it's just such a mess that I have a hard time believing it's not going to blow up... Do any of you HTML gurus see a problem here?
 
HTML is not programmed.

See 'favicon' at wikipedia.com for a good explanation of this.

 
Thanks for the clarification. I was trying to say that I don't understanf HTML.

Really, I was just hoping somone would have a quick look at the code & tell me if it is sound.
 
I was trying to say that HTML is not a programming language and should not be foreign to graphic designers.

Wikipedia shows the HTML that you need.
 
(no, the HTML is not sound. It is redundant and the first 'href' makes no sense.)
 
I thought something like that might be the case. I simply do not understand HTML in depth.

I had gone to Wikipedia & used their code early on, but it did not work in all the browsers I tested. I tested the code in IE6, IE7, Safari, & Firefox. I don't remember which ones the Wiki code didn't work in, but it was not universaly successful.
 
Wikipedia explains how favicons are not universally successful under the 'Guidelines' section. There are cache issues and variance in browsers that a web designer cannot overcome.

The most important line at wikipedia is:
It is no longer necessary to include the below code to ensure a favicon will show in the address bar if your favicon is named favicon.ico and is in the root directory.

The only time you really need to use HTML to refer to favicon is if you want a favicon to be different for a subdirectory. You do not need to mess with this HTML if you only have one favicon to display for the entire site.

You, as the designer, may think you are having favicon rendering problems simply because you have been fiddling with the HTML and your browser's cache has been affected. The average visitor is not monkeying with their cache by testing different HTML. Just leave favicon.ico at your root and get rid of the HTML.
 
-Are you serious? I don't need -any- html? Just leave the favicon (favicon.ico) in the root dir (with index.htm) & be done with it? Not a single line of code needed?

Sorry if I'm coming across dense here... Thank you very much for lending a hand.
 
It's true, all you have to do is leave the favicon.ico in your web sites root dir and all your web pages will use it.

The only time you need to add html is if you want different dirs of your site to use differant favicons.

It should be noted that the most popular browser, IE6, is very buggy and has problems with favicons. There is nothing you can do about that.
 
Thank you both very much. Issue resolved. I had indeed been doing alot of testing with IE6...

Why doesn't everyone just use firefox? *rhetorical* :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top