Steven Hammons
Steven Hammons

Reputation: 1810

How do I put image in url in HTML?

How do I put image in url in HTML? Just left of the address bar.

Upvotes: 1

Views: 4261

Answers (5)

philippe_b
philippe_b

Reputation: 41318

Short answer, simple solution

Design a 16x16 file in ICO format, call it favicon.ico and place it at the root of your web site (eg. http://mywebsite.com/favicon.ico).

Your favicon will look okay in classic, desktop environments (Windows+IE, Windows+Chrome, etc.).

Long answer, complex (or not) solution

The real answer is complex. The first case to address is the small icon in the tabs of PC's browsers. This is easily done, see the first solution above. Then, you have a lot of additional cases to consider:

You can look at this complete favicon picture list.

If you want to cover everything, I suggest you to use this favicon generator. It creates all these pictures at once and also the corresponding HTML code. Full disclosure: I'm the author of this site.

Upvotes: 0

Dylan Valade
Dylan Valade

Reputation: 5605

I remember driving myself crazy trying to figure out how to make an icon file type. To create an icon file (.ico extension) you can either use a graphics program that exports ico's (I prefer Fireworks) or use an online .ico generator which takes a JPG, PNG or GIF as input. 16x16 is the smallest file size for .ico that you will want to use. You don't need to put the favicon.ico in your root directory although that is most common. Using the link tag you could also use a relative link to file in a different folder. The file can be named logo.ico or even logo.png if the browser supports PNG for the favorites/shortcut icon. Internet Explorer only supports .ico so everyone uses .ico. Example with non-root directory:

<link rel="shortcut icon" href="/media/images/website_graphics/favicon.ico" />

Generate a favicon.ico file from a JPG, PNG or GIF

Upvotes: 0

Stuart
Stuart

Reputation: 66882

Take a look at the wikipedia entry for favicon - http://en.wikipedia.org/wiki/Favicon

The format for this is an .ico file and you need to place this in the root folder of your webserver.

For more advanced scenarios, you can also have a different icon per page by using:

<link rel="shortcut icon" href="http://www.example.com/myicon.ico" />

Upvotes: 6

buda
buda

Reputation: 2372

Just copy file with name facicon.ico in you website root and image will appear.

Upvotes: 2

Spyros
Spyros

Reputation: 48636

This is called a favicon actually. Just create your 16x16 pixels icon, name it "favicon.ico" and put it into your document root.

Upvotes: 1

Related Questions