Reputation: 2899
I'm trying to make a simple web page, and the site icon is being overwritten by the icons of other pages I've viewed.
A while ago I created a simple favicon.ico file and I identified it in the head of my page with this line:
<link rel="icon" href="favicon.ico" type="image/x-icon"></link>
I'm viewing the site through server at localhost:8080. When I view the site's source and click on the link to the icon file, it takes me to localhost:8080/favicon.ico and successfully displays the icon, so there are no problems there.
However, before I made the icon I visited gmail and then my page. After that the page showed up with the gmail logo rather than my logo. (I'm using Chrome, so I'm identifying the logo by what shows up in the tab displaying the page.) When I added my logo to the page, the gmail one persisted.
As an experiment, I tried changing the logo's href to "http://www.brown.edu/favicon.ico" (the Brown University logo). This worked. Then I changed it back to "favicon.ico". This did not work; the Brown logo is still there. I've also tried clearing my cache, which should have removed all icons in memory. After one refresh, the Brown icon disappeared and was replaced by the default "folded page" icon. After another refresh, the Brown icon came back.
Not a vital issue, but I'm still out of ideas. Any help?
Upvotes: 0
Views: 552
Reputation: 884
<link>
is a self closing tag.
<link rel="icon" href="favicon.ico" />
Also add this line if you want IE support.
<link rel=" shortcut icon" href="favicon.ico" type="image/x-icon" />
Upvotes: 1