Icon as an Image?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David Ross

    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/>.
  • Alan J. Flavell

    #2
    Re: Icon as an Image?

    On Fri, 4 Mar 2005, David Ross wrote:
    [color=blue]
    > Is it valid to have the SRC attribute of an IMG tag point to an
    > icon file (.ICO)?[/color]

    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.
    [color=blue]
    > This works okay with Mozilla. However, at my local public library
    > (which uses a clone of IE), all I see is the ALT text.[/color]

    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.

    Comment

    • me

      #3
      Re: Icon as an Image?

      "David Ross" <nobody@nowhere .not> wrote in message
      news:4228F90E.1 7EFF4C8@nowhere .not...[color=blue]
      > Is it valid to have the SRC attribute of an IMG tag point to an
      > icon file (.ICO)?[/color]

      IIRC not really.
      [color=blue]
      > 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/>.[/color]

      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


      Comment

      • Richard

        #4
        Re: Icon as an Image?

        On Fri, 04 Mar 2005 16:10:54 -0800 David Ross wrote:
        [color=blue]
        > 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.
        >[/color]

        So change it to a gif. It will look just the same.


        Comment

        • thelem
          New Member
          • Jul 2006
          • 1

          #5
          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_FAV ICON_URL}" width="17" height="17" style="overflow : hidden;" frameborder="0" marginheight="0 " marginwidth="0" ></iframe><![endif]-->
          <!-- If not IE --><comment><im g src="{STYLE_FAV ICON_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)

          Comment

          Working...