Adding Icon to Webpage

ImDaFrEaK

Well-known member
Joined
Jan 7, 2006
Messages
416
Location
California
Programming Experience
5-10
I know this has to be a stupid question but I'm stumpted right now. How do I add an Icon to my webpage. The icon that you see in the Internet Explorer representing the current page. Like for example; this forums site shows the Visual Studio Icon in the tab for this page (in IE7) and in the upper left corner of the web browser in earlier versions. How do I add a custom icon to my webpage(s) or site.
 
I figured out how to do it.
Add this tag in your <header>
VB.NET:
[SIZE=2][COLOR=#0000ff]</[/COLOR][/SIZE][SIZE=2][COLOR=#800000]head[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]>[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]     <[/COLOR][/SIZE][SIZE=2][COLOR=#800000]link [/COLOR][/SIZE][SIZE=2][COLOR=#ff0000]rel[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]="SHORTCUT ICON" [/COLOR][/SIZE][SIZE=2][COLOR=#ff0000]href[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]="http://www.yoursite.com/myicon.ico">[/COLOR][/SIZE]
This is how you add an icon to your site so I imagine you can change this programmatically as well. We'll see. I bet everyone already knew this but me anyways.
 
From what I know you have to drop a icon in the root of your folder structure named "favicon.ico" which has pretty limited specs, I think it's 16x16 px and 16 colors, maybe 256 colors, or create an ICO that has both.
 
As with everything, different browsers handle the favicon differently. Some only need the favicon.ico file to be in a certain place, others need the element type shown by ImDaFrEak.
It is possible to use formats other than ico including png and animated gifs. Of course different browsers have different capabilities.
An article on wikipedia.
 
Back
Top