PDA

View Full Version : Image on the URL Bar



Heald
3rd March 2005, 11:39 AM
Yo.

Some schoolfriends and I are making a new website. I was wondering what the code was for the image that appears in the URL bar on the left of the URL. For example, at the moment, the image I'm seeing there is the TPM logo (a black P and M in a white hexagon with a black outline). Can you help me please?

Dark Scizor
3rd March 2005, 11:55 AM
I've been wondering this as well.

http://img162.exs.cx:81/img162/2269/untitled7vs.jpg

I think it could be in this line, i saw it in the sourcecode of imageshack.us

<link rel="stylesheet" href="img/style-def.css" type="text/css">
<LINK REL="SHORTCUT ICON" HREF="http://www.imageshack.us/favicon.ico">

It seems to be above the rest of the source code (apart from the title), so it seems to make enough sense. But I'm kinda rough on html and everything else to do with web design, so if Kainashi or someone can help me verify this?

Ask on the firefox forums as well, they might be able to help.

Chris
3rd March 2005, 11:57 AM
That's called a favicon. :)

Firstly you'll need to make a 16 pixel-square icon and save it as an .ico file (you could use software like IconEdit Pro (http://www.iconedit.com) to create the icon) - be sure to use less than 256 colours though.

Upload your new .ico file as favicon.ico in the root directory of your web server (in binary mode if you're using FTP). Then add the following HTML in the <head> portion of your code:


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

Where /favicon.ico is the path to your the favicon.ico file that you uploaded earlier. The icon will then be visible in the URL bar and in the Bookmarks list of all modern browsers. :)

Dark Scizor
3rd March 2005, 11:59 AM
Yay, i was right about it ^__^

Heald
4th March 2005, 01:51 PM
Ah! Worked like a charm! Thanks guys!

Cheesey
4th March 2005, 02:18 PM
Just wondering, but why is it that sometimes the favicon of a site decides to transfer itself to another url too? I thought it might have something to do with a site with no favicon being accessed straight after being at one which does have one (hope I didn't make that sound too confusing) but given the sporadic cloning of them I wasn't so sure.

For example, Tsuyoi's Lair has decided to claim TPMs favicon as its own (TPM still has the favicon, though). And my AC/CC/ASB page has also decided to use my LJ favicon. Just wondering if there was any reason for that.

kainashi
4th March 2005, 02:21 PM
Just wondering, but why is it that sometimes the favicon of a site decides to transfer itself to another url too? I thought it might have something to do with a site with no favicon being accessed straight after being at one which does have one (hope I didn't make that sound too confusing) but given the sporadic cloning of them I wasn't so sure.

For example, Tsuyoi's Lair has decided to claim TPMs favicon as its own (TPM still has the favicon, though). And my AC/CC/ASB page has also decided to use my LJ favicon. Just wondering if there was any reason for that.using firefox by any chance? if so, i think that's a small bug, if i remember correctly.

Cheesey
4th March 2005, 02:27 PM
Yeah, I'm using Firefox. It's good to know it's just a bug, though, and not my computer screwing up. Does it just randomly copy favicons, then?

youdontknowme
4th March 2005, 07:22 PM
lol, happens to me all the time. Like, I'd go to TPM and then some site on my link bar thing has the TPM icon...