Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Michael Morton
4,902 PointsFavicon Code
Hi everyone,
I've created a favicon and uploaded it to my root directory. But for some reason it still isn't showing up in the URL bar.
Here's the code I'm using. Is it correct? FYI - I'm viewing my site in Safari.
<link rel="shortcut icon" href="/favicon.ico" >
8 Answers
Jeffrey Kam
1,734 PointsTry visiting the path of the favicon in your browser. I found that this sometimes works.
So if your favicon is at http://mysite.com/favicon.ico, just visit that url in your browser and it sometimes will force the browser to load the favicon.
Ernest Grzybowski
Treehouse Project ReviewerThere's ton's of websites and blog posts just dedicated to this. The biggest thing I have found, is that most browsers cache the favicon. Try opening your website in another web browser and see if it comes up. If it does, then just try clearing your cache from your main browser. Let me know how it goes.
James Barnett
39,199 PointsYour code works on IE, so you should definately keep it, just add in <link rel="icon" href="/favicon.ico"> for other browsers.
source: http://www.jonathantneal.com/blog/understand-the-favicon/
Michael Morton
4,902 PointsThanks for the response gentlemen.
James - I'm also using IE9 but I'm still not seeing the favicon. Are you seeing it on your machine?
I also checked Firefox. It shows up in Firefox but not in Chrome, IE or Safari.
Could it be a caching issue?
Ernest Grzybowski
Treehouse Project ReviewerIs the favicon in your root directory?
Michael Morton
4,902 PointsErnest,
Yes the favicon is in my directory.
Michael Morton
4,902 PointsThanks Jeffrey,
That seems to do the trick! Thanks for your help. It's much appreciated! :)
Jeffrey Kam
1,734 PointsNo problem! I'm glad it worked!