robertmyers
robertmyers

Reputation:

Personalized icon next to the URL address in the browser's address bar?

How do I write code where a company icon appears on the left side next to the URL address in the browser's address bar?

Upvotes: 8

Views: 4309

Answers (6)

y0mbo
y0mbo

Reputation: 4602

You need to create a favicon. The favicon uses a standard (in Windows, at least) .ico file. If you have a logo, you can convert it at sites like http://www.favicongenerator.com/

In the <head> of your html page, use the <link> tag to define the location of the favicon like this:

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

You may need to refresh the page for the icon to display.

Upvotes: 4

grapefrukt
grapefrukt

Reputation: 27045

In modern browsers other fileformats than .ico works aswell. You can even put animated gif's in there!

Upvotes: 0

user400
user400

Reputation:

DynamicDrive has an easy favicon maker too.

Different pages/directories can also call a different .ico with code similar to y0mbo's example (this is what Mint uses):

<link href="sc/ph645.43/images/icons/mint.ico" rel="icon" type="text/x-icon" />

This is a good article on favicons in detail.

I suspect animated favicons have the potential to go the way of the blink tag. Mint is using theirs to match their overall design, if you visit in FF3, you'll see that it matches the green color that FF uses to designate a recognized SSL cert.

Upvotes: 0

DevelopingChris
DevelopingChris

Reputation: 40788

it loads www.whateveryouron.com/favicon.ico

if your domain is robermyers.com, just put a favicon.ico 16px icon thats accessible, and you're in like flint. just try this googles or stackoverflows

Upvotes: 4

Grant
Grant

Reputation: 12049

load a file on the webserver called favicon.ico

Upvotes: 0

Michael Stum
Michael Stum

Reputation: 180954

You are looking for a Favicon.

Upvotes: 8

Related Questions