...

View Full Version : Icons in address bars



munchyboff
10-05-2004, 01:37 PM
I dont know if this is html or not, but how can you put your own icons in the address bar, like what google has?

]|V|[agnus
10-05-2004, 03:43 PM
<link rel="shortcut icon" href="favicon.ico">

To create the *.ico file you will need a graphics editor of some kind. There are some nice ones that you can get free trials of to play with. The file itself needs to be 16x16 and I think you have a maximum color depth to consider too. Likely 256 colors, but I am not sure. Perhaps 16-bit.

http://www.awicons.com/

That one is rather nice from what I've seen of it.

lalo
10-06-2004, 01:57 AM
it also works if you just place the "favicon.ico" on your server, it is not really needed to place the link that ]|V|[agnus mentioned above. (but if I'm wrong let e know)

gohankid77
10-06-2004, 03:33 AM
What, lalo? Do you mean the <link> tag? That is the only way to call a "shortcut icon".

glenngv
10-06-2004, 05:53 AM
IE automatically searches for icon named favicon.ico in the root and places it next to Favorites link and URL in the address bar everytime a page is bookmarked. No need for the <link> tag unless you want a different filename.

http://msdn.microsoft.com/workshop/Author/dhtml/howto/ShortcutIcon.asp

lalo
10-06-2004, 06:06 AM
well, at least that I know of IE, Netscape and Firefox automatically find it withouth the link, not sure about other browsers though .

hemebond
10-06-2004, 06:18 AM
well, at least that I know of IE, Netscape and Firefox automatically find it withouth the linkWhich is a bad thing for user-agents to do.

lalo
10-06-2004, 08:42 AM
Which is a bad thing for user-agents to do.
ok, so you are saying that we "should" have the link then?

liorean
10-06-2004, 11:18 AM
Netscape and Firefox does that too? I thought they required the link for it.

And yes, you SHOULD have the link element on the page if you want site icons to work.

gohankid77
10-06-2004, 03:32 PM
User-agents should not search for the icon. That is going against "Teh Kode O Teh Webb Devellopperz". Actually, user-agents are reaching out to a server. If a hacker found out how to keep that gateway open long enough, he/she could put malware, viruses, or even trojans on your computer. Eventually, the Web would become chaotic and would need to be completely recreated.

That's my theory anyway. :p

]|V|[agnus
10-06-2004, 05:23 PM
Sounds more like a reflection of current reality... ;)

But yes, it is bad juju for UAs to be automatically looking for anything, for the most part. Their function is to do what they're told, not do as they please.

lalo
10-07-2004, 03:44 AM
so you guys are saying that if we place the link to the favicon, the User-agents should not even "bother" to look on our server for nothing else ? :p

tsguitar2004
10-07-2004, 04:43 AM
What's being said is that for a UA to *automatically* look for that, without being told to do so, is a potential window to take advantage of. What should be looked for is only what we code it to look for. It shouldn't do anything of its own accord.
-ts

{{suddenly I'm flashing back to TRON; those poor, poor UAs...}}

hemebond
10-07-2004, 06:07 AM
Netscape and Firefox does that too? I thought they required the link for it.

And yes, you SHOULD have the link element on the page if you want site icons to work.Yes, unfortunately they do. But, they also implement the link element correctly (and incorrectly to match IE). The actual code to use is
<link rel="icon" href="/favicon.png" type="image/png">Obviously the href and type can be different, but take note of the rel. rel takes a space-seperated list of values. This means that an element that has
rel="shortcut icon"actually has two values; "shortcut" and "icon". IE gets this wrong (surprise) by thinking "shortcut icon" is one value.

lalo
10-07-2004, 07:44 AM
so by default the correct link should be ??? :

<link rel="icon" href="favicon.ico" type="image/ico"> :confused:

hemebond
10-07-2004, 07:55 AM
<link rel="icon" href="/favicon.ico" type="image/x-icon">http://filext.com/

lalo
10-08-2004, 03:42 AM
thanks

gsnedders
10-08-2004, 06:04 PM
It always safer to put something like
<link rel="shortcut icon" href="http://www.geoffers.uni.cc/favicon.ico" />
<link rel="shortcut icon" href="http://geoffers.uni.cc/favicon.ico" />
<link rel="icon" href="http://www.geoffers.uni.cc/favicon.ico" />
<link rel="icon" href="http://geoffers.uni.cc/favicon.ico" /> to get maximum support ;)

gohankid77
10-08-2004, 06:10 PM
The HTML WG actually lists the possible values for rel/rev (http://www.w3.org/TR/xhtml2/mod-metaAttributes.html#adef_metaAttributes_rel) for the current XHTML 2.0 WD (http://www.w3.org/TR/xhtml2).

What!? No 'stylesheet' value!? @import will be useful...

gsnedders
10-08-2004, 06:13 PM
You'll be including CSS a better way ;)

You'll be including them as true XML stylesheets:



<?xml-stylesheet href="persistent.css" type="text/css" media="screen"?>
<?xml-stylesheet href="default.css" type="text/css" media="screen" title="default"?>

gohankid77
10-08-2004, 06:22 PM
Not if CSS3 will still support the @import method.
http://www.w3.org/TR/css3-syntax/#at-import

lalo
10-08-2004, 06:22 PM
It always safer to put something like
<link rel="shortcut icon" href="http://www.geoffers.uni.cc/favicon.ico" />
<link rel="shortcut icon" href="http://geoffers.uni.cc/favicon.ico" />
<link rel="icon" href="http://www.geoffers.uni.cc/favicon.ico" />
<link rel="icon" href="http://geoffers.uni.cc/favicon.ico" /> to get maximum support ;)
wouldn't it be simpler and easier like
<link rel="shortcut icon" href="favicon.ico" />
<link rel="icon" href="favicon.ico" />after all if its on your root folder that's understandable by all user agents, isn't it.

gsnedders
10-08-2004, 06:41 PM
There are problems with that...

gohankid77
10-08-2004, 06:48 PM
Such as?

gsnedders
10-08-2004, 07:10 PM
The problem is... I can't remember the problems...

liorean
10-08-2004, 07:20 PM
Not if CSS3 will still support the @import method.
http://www.w3.org/TR/css3-syntax/#at-importWhy would you want to do that? The xml-stylesheet PI is supported by XML and XHTML user agents. XHTML2.0 is designed to be incompatible with HTML/SGML, instead building a more semantical structure starting from an XML perspective. It also happens to have a specific namespace that is different from that of previous XHTML versions, so as to prevent it from being treated as XHTML1.0/1.1 by XHTML user agents.



All in all, mentioned features already remove all backward compatibility with non-xml-enabled, non-namespace-aware, non-XHTML2-namespace-supporting, non-XHTML-MIME-type-aware browsers. This effectively sorts out ALL current browsers. However; WebKit (saf), KHTML (konq, and is also the base for WebKit), Presto (op) and Gecko (moz) already support all features but the XHTML2 namespace; which means that XHTML2 support can be bootstrabbed to them easily as soon as the XHTML2 semantics for the namespace have been written.
The old Mozilla engine (nn4 and earlier), the Tasman engine (iem) and the Trident (iew) engine will not have as easy to support it, however, because they lack some XML support and namespace awareness. Essentially, if Microsoft wants to support XHTML2, they need either a new browser front end (rendering engine) or they need to seriously revamp the Trident engine. Nn4 support is of course out of the question, except for the possibility of adding an XHTML2 supporting plug-in to it.



Now, what are the benefits of using @import in a style element instead of using an xml-stylesheet PI, when you have already removed the most common reason for using it: filtering out browsers with low support for CSS? It's a couple of characters shorter in it's smallest form, and that's it.
The xml-stylesheet PI is, first of all, the recommended way of including style sheet in any XML document, independent of which XML based markup language it uses. Second, it works even if the XML user agent is not XHTML2 namespace aware. XHTML2 semantics are in this case missing, so the browser doesn't know the content of the style element is supposed to be handled by the CSS engine, and don't know that the src attribute means that it should load an external file for contents representation. Third, the xml-stylesheet PI is the only way to declare style sheets that are not persistent (that is, alternate or preferred). Fourth, using xml-stylesheet PI works in most browsers TODAY, which is not the case for the style element. (Because of the reasons mentioned: XHTML2 should be presented as XHTML/XML and does not use the same namespace as XHTML1.)

gohankid77
10-08-2004, 08:06 PM
Thank you, liorean. I checked it out for myself since your post was typed in such great detail. I will begin to use the xml-stylesheet PI. Of course, this calls for a list of comparison!

<link /> - X/HTML, usable in older browsers
@import - CSS, not usable in some older browsers
<?xml-stylesheet?> - XML, usable only in the following browsers (Camino, Konqueror, Mozilla, Opera, Safari, Firebird/Firefox, Netscape 6+, IE6-not supported too well)

Feel free to correct me if I am wrong.

gsnedders
10-08-2004, 08:10 PM
<?xml-stylesheet?> - XML, usable only in more recent browsers (Firebird, Netscape, IE6-not supported too well)

Camino, Konqueror, Mozilla, Opera and Safari also support it.

gohankid77
10-08-2004, 08:30 PM
It has been edited. Thanks to Error404. I don't own a Linux PC or a Mac, so I can't test on those OS's!

liorean
10-08-2004, 08:34 PM
Thank you, liorean. I checked it out for myself since your post was typed in such great detail. I will begin to use the xml-stylesheet PI. Of course, this calls for a list of comparison!
Note that this discussion was all about what method you should use in generic XML or in XHTML2. There are other considerations in HTML and XHTML1.

- In XHTML1 sent as XML, you should use the xml-stylesheet PI.
- In XHTML1 sent as XHTML, the only browser that doesn't support the xml-stylesheet PI is MSN/OSX (Tasman 0.9). Thus, you might want to use the link element instead.
- In XHTML1 sent as HTML, you have only the choice between link and style elements. It is recommended that you use the link element with the media attribute set to "screen, projection" instead or the style element with an @import rule in order to associate the document with an external style sheet, and it is recommended that you don't embed style sheets in the style element for other than testing purposes, because of the rediculous escaping methods necessary for the handling you want in both XHTML and HTML parsers.

gohankid77
10-08-2004, 08:50 PM
XHTML1 as XML - I don't use it
XHTML1 as XHTML - I use it almost always
XHTML1 as HTML - I only use it for testing

External Style Sheets - I use them most often
Internal Style Sheets - I only use them for testing and move them to an external style sheet
Inline Style Sheets - I use them if the style declarations I wish to use will only affect a single element rather than a group of elements

<link /> - I rarely use it
@import - I use it almost always
<?xml-stylesheet?> - I am currently in the process of switching (mentally, then actually)

That's my coding profile.

I've actually looked at the XHTML2 WD and I like almost (almost) everything that was changed. I wonder if XFrames will somehow be implemented....

hemebond
10-08-2004, 10:17 PM
In XHTML1 sent as XHTML, the only browser that doesn't support the xml-stylesheet PI is MSN/OSX (Tasman 0.9). Thus, you might want to use the link element instead.Internet Explorer doesn't support XHTML at all. If you want to support IE, you need to serve HTML.

liorean
10-10-2004, 04:01 AM
Hemebond: I maybe didn't say it, but throughout these discussions, when I talk about browsers not getting it right, that assumes they try to support it. Iew wasn't even in the game, since it doesn't try to render documents sent as XHTML. My base discussion for XHTML sent as XML only included XML savvy browsers, which means that nn4, MSN/OSX and iem are excluded. My base discussion for XHTML sent as XHTML only included XHTML savvy browsers, which means that iem, iew and nn4 are exluded. My base dicussion for XHTML sent as HTML only included HTML savvy browsers, thus excluding potential future non-HTML XML/XHTML browsers.

I didn't in that post at all mention the the basis for whether you should serve the document as XML/XHTML/HTML, I only mentioned the considerations for how you should be associating the document with the style sheet given a certain way to serve the document.

nero0102
10-18-2004, 02:13 AM
<link rel="shortcut icon" href="http://www.aet.cup.edu/~sengel/favicon.ico" type="image/x-icon" />
<link rel="icon" href="http://www.aet.cup.edu/~sengel/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="http://aet.cup.edu/~sengel/favicon.ico" type="image/x-icon" />
<link rel="icon" href="http://aet.cup.edu/~sengel/favicon.ico" type="image/x-icon" />

This is what I have for my webpage.

However it works in FireFox but not in IE.

I have been trying many different configurations and even move/copied my icon all over the place and it still won't show in IE.

I even tried using the direct root to the icon file instead of the ~sengel part which "hides" the www_public and home parts

What gives?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum