PDA

View Full Version : Little icons in address bar


Andalucian Traveller
17th April 2008, 10:40 PM
Does anyone know how you do those little icons that appear on the left-hand side of the address bar (not sure of terminology), like the one this forum has? Is it done with javascript?

deecree
17th April 2008, 11:17 PM
Does anyone know how you do those little icons that appear on the left-hand side of the address bar (not sure of terminology), like the one this forum has? Is it done with javascript?

It's called a "favicon". You need to create a favicon.ico file and put it in the root of the domain. Browsers will pick it up and display it if and when they please.

deecree
17th April 2008, 11:17 PM
Here's Ben's favicon...

http://www.notesfromspain.com/favicon.ico

gastephen
17th April 2008, 11:26 PM
Does anyone know how you do those little icons that appear on the left-hand side of the address bar (not sure of terminology), like the one this forum has? Is it done with javascript?

No, it is not done with JavaScript. The legacy method is to include an icon file (named favicon.ico) in your document root. You can create a .ico file from a source image using this tool: http://www.html-kit.com/favicon/

A more flexible method of associating the icon with a page is to use an appropriate <link> element in your page's <head>. That way you can specify a location for it other than in the root.

Read more about this here (http://msdn2.microsoft.com/en-us/library/ms537656%28VS.85%29.aspx).

Cheers, G.