473,408 Members | 2,025 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Icon as an Image?

Is it valid to have the SRC attribute of an IMG tag point to an
icon file (.ICO)?

I have a few pages that do this. See my
<URL:http://www.rossde.com/sitemap.html>.

This works okay with Mozilla. However, at my local public library
(which uses a clone of IE), all I see is the ALT text.

--

David E. Ross
<URL:http://www.rossde.com/>

I use Mozilla as my Web browser because I want a browser that
complies with Web standards. See <URL:http://www.mozilla.org/>.
Jul 23 '05 #1
4 3831
On Fri, 4 Mar 2005, David Ross wrote:
Is it valid to have the SRC attribute of an IMG tag point to an
icon file (.ICO)?
HTML validity cares nothing about the details of URL attributes, as
long as the appropriate characters are properly encoded.

Back around 10 years or so back, it was quite usual to specify
postscript files in <img src=...> attributes. I don't know any reason
in theory why one couldn't specify other kinds of resource: any client
agent which hasn't implemented your content-type is *supposed* to
display the alternative text, and offer access to your longdesc URL,
after all.
This works okay with Mozilla. However, at my local public library
(which uses a clone of IE), all I see is the ALT text.


So it's working as designed (as far as the alt text is concerned,
anyway - what about the longdesc?). And this is *despite* the fact
that IE brazenly lies about its Accept: abilities when retrieving
<img...> URLs, and therefore doesn't really deserve to play in this
particular game.

Jul 23 '05 #2
me
"David Ross" <no****@nowhere.not> wrote in message
news:42***************@nowhere.not...
Is it valid to have the SRC attribute of an IMG tag point to an
icon file (.ICO)?
IIRC not really.
I have a few pages that do this. See my
<URL:http://www.rossde.com/sitemap.html>.

This works okay with Mozilla. However, at my local public library
(which uses a clone of IE), all I see is the ALT text.

--

David E. Ross
<URL:http://www.rossde.com/>

I use Mozilla as my Web browser because I want a browser that
complies with Web standards. See <URL:http://www.mozilla.org/>.


I use IE6 and the .ico file failed to load the first time I visited. Then I
entered http://www.rossde.com/editorials/safespace.ICO and the .ico file
appeared in the browser by it's self as I expected it would. Then I reloaded
the page and the .ico file appeared. I can only guess that downloading the
..ico file by it's self had some how trained IE to accept the file as a
legitimate web graphic even though IIRC it's not. I hope this helps.
Signed,
me
Jul 23 '05 #3
On Fri, 04 Mar 2005 16:10:54 -0800 David Ross wrote:
Is it valid to have the SRC attribute of an IMG tag point to an
icon file (.ICO)?

I have a few pages that do this. See my
<URL:http://www.rossde.com/sitemap.html>.

This works okay with Mozilla. However, at my local public library
(which uses a clone of IE), all I see is the ALT text.


So change it to a gif. It will look just the same.
Jul 23 '05 #4
thelem
1
Sorry to drag up an old thread, but it poped up on a google search for me and I've got an answer other people may find useful:

<!--[if IE]><iframe src="{STYLE_FAVICON_URL}" width="17" height="17" style="overflow: hidden;" frameborder="0" marginheight="0" marginwidth="0"></iframe><![endif]-->
<!-- If not IE --><comment><img src="{STYLE_FAVICON_URL}" width="16" height="16" border="0"></comment>

IE will display the favicon using the IFRAME (which unfortunatly needs to be 1px too big in both dimensions), and everything else will use the IMG tag (since only IE supports the comment tag)
Jul 18 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: arenaTR | last post by:
I'd like to put a logo in the titlebar of my webpage. The one I'm talking about is the one that's next to the URL in the address bar in both netscape and IE. Just so I'm clear, for example, on...
3
by: Hai Ly Hoang [MT00KSTN] | last post by:
I have written an WindowApplication (in C# with VS7) . It target file is MyApp.exe. It's default icon (display in Windows Explorer) is not pretty. I replaced file app.ico in project directory with...
1
by: jack xu | last post by:
just like outlook when you insert a attachment ,a icon image of the file you selected will show in a textbox. Thanks.
0
by: - HAL9000 | last post by:
Reference the visual basic power pack: http://msdn.microsoft.com/library/en-us/dv_vstechart/html/vbpowerpack.asp I have been using win32 SHGetFileInfoW to get icons for my "FileViewer" &...
6
by: Udi | last post by:
Hi, I have an imagelist initialized in design time with several icons files (.ico). However, when I need to extract an icon (Image) from the Imagelist, I can't convert it back to an icon: ...
7
by: ozzy66 | last post by:
Heya NG, I've got a little confusing configuration scenario: I've created a simple windows form in c# with Visual Studio 2003.NET and simultaneously with VS 2005. I've designed an Icon as...
1
by: flaerpen | last post by:
Hi, I'm trying to use the function paste() to paste a image into another image but I can't get it work! Is it the right function to use or is there any other function that's better? Here's my very...
1
by: =?Utf-8?B?QWRhbQ==?= | last post by:
I'm having a problem loading an Icon into an ImageList. When I load the icon directly it works fine, like this: Icon sourceIcon = << Get an icon from somewhere... >>;...
1
by: John | last post by:
I have a switchboard and wish to add an image to the buttons via the switchboard table. I have added an extra column in the switchboard table with the names of embedded ico images corresponding to...
4
by: Marcolino | last post by:
Hi, I have simple needs but I don't know how to implement it. I have application that create Dynamic Button. I need to set the image on this button, getting the icon from a form. So pratically...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.