FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


how to display icon in the the address bar of browser





umeshtangnu
hi,
how can i show an icon in the browser address bar like this site has,
plz help
stuck
hi
you must have an image
and add to your source code of your webpage this code:

<link rel="shortcut icon" href="../images/favicon.gif">

where "../images/favicon.gif" must be the path of the image you want to put on address bar

the image must be 16x16 px

regards,
stuCk
outofnicks
Hmmm, I didn't realize you could use a GIF for favicons, thought a Windows Icon format (.ico extension) was necessary. I do believe that if you use an .ico image, then you don't need the link in (or the browser, whichever the case). That link for a GIF image would have to be inserted into every page, if I'm not mistaken.
X3 Talk
Don't know if it would have be fitted into every page. I think the browser records it for a particular domain name, then does it for every file in that.
Indi
As always, things aren't that simple.

You can use GIFs, PNGs or ICO files... sort of. (In fact, if you check, Frihost uses a GIF.)

You don't need the <link> tag... sort of.

This will probably be easier to do step by step....

Option 1: favicon in root
You can create a Windows icon resource format file (ICO), and put it in the root directory of your website. On Frihost, that is your public_html directory. It has to be named "favicon.ico".

It may contain multiple resolutions and colour depths, but for best results, you should have one at 16x16 256 colours.

This works for most browsers, but it's a bad idea. Don't do it.

Option 2: <link>
In the <head> of your HTML or XHTML, put this:
Code:
<link rel="icon" type="mimetype" href="path" />

"mimetype" should be the MIME type of the image you're using. So for:
"ICO": use "image/vnd.microsoft.icon"
"GIF": use "image/gif"
"PNG": use "image/png"

And "path" is the path to the image, which can be anywhere.

Note, rel="shortcut icon" is the old form, and it is not legal. If the browser you want to support doesn't support rel="icon", then you should add both rel="shortcut icon" and a rel="icon" <link> tags, not just rel="shortcut icon".

So if your favicon is "siteicon.gif" and it's in your "/public_html/icons", your tag would be:
Code:
<link rel="icon" type="image/gif" href="/icons/siteicon.gif" />


And if you really feel the need to support old browsers:
Code:
<link    rel="icon"             type="image/gif"    href="/icons/siteicon.gif" />
<link    rel="shortcut icon"    type="image/gif"    href="/icons/siteicon.gif" />
Related topics
Windows Tips&tricks!
751 Useful Windows XP Files
Fire Fox address bar small icon
Icons in address bar
address bar image
Fields appearing in URL address bar
Logo in the address bar ?
Assigning a variable in PHP by address bar
Keyboards Shortcuts
Javascript, writing code in the address bar without clearing
Delete Data from the Address Bar (Fire Fox and Explorer)
Windows shortcuts, must know
colouring the address bar
Yahoo Search Results from Address Bar of Firefox Searches
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.