Not having to type 'alt=""' in every link?

Discussion in 'HTML' started by (Pete Cresswell), Oct 17, 2004.

  1. I've got a list of several hundred links whose code would look a little cleaner
    if it didn't have to contain 'alt=""' for every img element.

    Seems like something that could be covered in <base>, but I can't make it work.

    e.g.
    --------------------
    <base target="showframe" alt="" />
    --------------------


    --
    PeteCresswell
    (Pete Cresswell), Oct 17, 2004
    #1
    1. Advertising

  2. (Pete Cresswell) wrote:
    > I've got a list of several hundred links whose code would look a little cleaner
    > if it didn't have to contain 'alt=""' for every img element.


    Setting alt="" may be useful for some decorative images, but why are you
    setting it for linked images? How do you expect users with voice or text
    browsers to use the links when you haven't provided any alternate text?
    Leif K-Brooks, Oct 17, 2004
    #2
    1. Advertising

  3. (Pete Cresswell) wrote:

    > I've got a list of several hundred links whose code would look a little
    > cleaner if it didn't have to contain 'alt=""' for every img element.


    I'm guessing that either you are using decorative images, in which case you
    might consider setting a non-repeating background image and some padding on
    the links (or using an image for the bullets in an unordered list), or you
    are using images which are relevant to the link destination and should have
    non-empty alternative content.


    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
    David Dorward, Oct 17, 2004
    #3
  4. On Sun, 17 Oct 2004 16:31:54 GMT, (Pete Cresswell) <> wrote:

    > I've got a list of several hundred links whose code would look a little
    > cleaner if it didn't have to contain 'alt=""' for every img element.


    Having no alt text for every image on a page seems very wrong to me. Even,
    perhaps especially, if they are link banners, they could at least contain
    the name of the linked site.

    > Seems like something that could be covered in <base>, but I can't make
    > it work.


    You don't seem to understand what the base element is for. It specifies
    the base URL for the document, used by the user agent to resolve relative
    addresses. In the Transitional and Frameset DTDs, it also indicates the
    default link target. It isn't for specifying any old default value, and it
    certainly doesn't have an alt attribute.

    [snip]

    > <base target="showframe" alt="" />


    Are you writing XHTML? If not, don't include the slash.

    [snip]

    Mike

    --
    Michael Winter
    Replace ".invalid" with ".uk" to reply by e-mail.
    Michael Winter, Oct 17, 2004
    #4
  5. RE/
    >but why are you
    >setting it for linked images? How do you expect users with voice or text
    >browsers to use the links when you haven't provided any alternate text?


    Validator.w3 seems to require it. In spite of much expert advice to the
    contrary, I'm still using a frame for the index. Reason: what I was able to
    read about why frames are evil mostly revolved around their defeating the nature
    of the web by compromising the bookmarkability of pages. In this case, the
    pages are imprisoned in a CD that people are reading in their local drive - so
    those reasons didn't seem to apply.

    Besides, I'm going on a wing and a prayer here and Frames are working.... Once I
    climb the learning curve a little more, I'll look for alternative ways to
    present a scrolling list of hundreds of links without having the top of the page
    disappear from view...but for now....

    I don't need an 'alt' address because the whole thing is on a CD - so the images
    are guaranteed to be there.

    There are hundreds of thumbnail images, that comprise a list of pictures that
    can be viewed.

    A few:

    ---------------------
    <div class="navlist">
    <p><a href="Pix\45th\DSCN9178.JPG"><img src="Pix\45th\ThumbNails\DSCN9178.jpg"
    alt=""/><br/>DSCN9178.JPG</a></p>
    <p><a href="Pix\45th\DSCN9179.JPG"><img src="Pix\45th\ThumbNails\DSCN9179.jpg"
    alt=""/><br/>DSCN9179.JPG</a></p>
    <p><a href="Pix\45th\r01-03.jpg"><img src="Pix\45th\ThumbNails\r01-03.jpg"
    alt=""/><br/>r01-03.jpg</a></p>
    <p><a href="Pix\45th\r01-04.jpg"><img src="Pix\45th\ThumbNails\r01-04.jpg"
    title="Our Entertainers" alt=""/><br/>r01-04.jpg</a></p>
    <p><a href="Pix\45th\r01-05.jpg"><img src="Pix\45th\ThumbNails\r01-05.jpg"
    alt=""/><br/>r01-05.jpg</a></p>
    <p><a href="Pix\45th\r01-06.jpg"><img src="Pix\45th\ThumbNails\r01-06.jpg"
    alt=""/><br/>r01-06.jpg</a></p>
    <p><a href="Pix\45th\r01-07.jpg"><img src="Pix\45th\ThumbNails\r01-07.jpg"
    title="Blake Tomlinson" alt=""/><br/>r01-07.jpg</a></p>
    <p><a href="Pix\45th\r01-08.jpg"><img src="Pix\45th\ThumbNails\r01-08.jpg"
    title="Goodrich, Miller, Anderson, Adams" alt=""/><br/>r01-08.jpg</a></p>
    <p><a href="Pix\45th\r01-09.jpg"><img src="Pix\45th\ThumbNails\r01-09.jpg"
    title="Schneeweis" alt=""/><br/>r01-09.jpg</a></p>
    <p><a href="Pix\45th\r01-10.jpg"><img src="Pix\45th\ThumbNails\r01-10.jpg"
    alt=""/><br/>r01-10.jpg</a></p>
    ......
    </div>
    ---------------------
    --
    PeteCresswell
    (Pete Cresswell), Oct 17, 2004
    #5
  6. (Pete Cresswell) wrote:

    >>but why are you
    >>setting it for linked images? How do you expect users with voice or text
    >>browsers to use the links when you haven't provided any alternate text?


    > Validator.w3 seems to require it.


    It doesn't. The HTML standard you claim to use requires it, the validator
    just tells you this.

    > In spite of much expert advice to the
    > contrary, I'm still using a frame for the index. Reason: what I was able
    > to read about why frames are evil mostly revolved around their defeating
    > the nature of the web by compromising the bookmarkability of pages. In
    > this case, the pages are imprisoned in a CD that people are reading in
    > their local drive - so those reasons didn't seem to apply.


    Why not? I've got more then a few bookmarks to resources stored locally.

    > Besides, I'm going on a wing and a prayer here and Frames are working.


    .... working in your test environment.

    > I don't need an 'alt' address because the whole thing is on a CD - so the
    > images are guaranteed to be there.


    Is the user guaranteed to be using a graphical browser?
    Is the user guaranteed to have eyesight good enough to see the images?

    > <div class="navlist">
    > <p><a href="Pix\45th\DSCN9178.JPG"><img
    > src="Pix\45th\ThumbNails\DSCN9178.jpg"
    > alt=""/><br/>DSCN9178.JPG</a></p>


    That doesn't look like a paragraph, it looks more like a list item. Your
    slashes are backwards. You are using XHTML, but failing to follow the HTML
    compatibility guidelines. I think a caption is likely to be more useful to
    the user then the filename.


    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
    David Dorward, Oct 17, 2004
    #6
  7. On Sun, 17 Oct 2004 17:51:07 GMT, (Pete Cresswell) <> wrote:

    [snip]

    > I don't need an 'alt' address [...]


    I'm curious to know if you meant that last word. The alt attribute doesn't
    specify an address, it specifies replacement text to display if the image
    cannot be rendered (for whatever the reason - some are below).

    There are few reasons to specify no alt text. The only one I can think of
    at the moment is that the image in question is purely decorative. As it
    isn't content, who cares if it isn't rendered?

    > so the images are guaranteed to be there.


    Alternative text isn't displayed just because the resource cannot be
    found. It's also rendered by text browsers, when the user disables image
    display, or if the browser cannot display that particular image format.
    Braille readers need alt text, too (for obvious reasons).

    [snip]

    Mike

    --
    Michael Winter
    Replace ".invalid" with ".uk" to reply by e-mail.
    Michael Winter, Oct 17, 2004
    #7
  8. RE/
    >I'm curious to know if you meant that last word. The alt attribute doesn't
    >specify an address, it specifies replacement text to display if the image
    >cannot be rendered (for whatever the reason - some are below).


    It was pure ignorance. I had just read about "text" and figured "alt" must be
    something like "Alternative Address Reference".

    >Alternative text isn't displayed just because the resource cannot be
    >found. It's also rendered by text browsers, when the user disables image
    >display, or if the browser cannot display that particular image format.
    >Braille readers need alt text, too (for obvious reasons).


    I think my brain is going on overload....
    --
    PeteCresswell
    (Pete Cresswell), Oct 18, 2004
    #8
  9. RE/
    >... working in your test environment.


    Good catch. I just got back from dinner at a friend's house. They have a Mac
    and my little house of cards collapsed - unable to resolve the file references.
    >
    >> I don't need an 'alt' address because the whole thing is on a CD - so the
    >> images are guaranteed to be there.

    >
    >Is the user guaranteed to be using a graphical browser?
    >Is the user guaranteed to have eyesight good enough to see the images?


    As above...

    >> <div class="navlist">
    >> <p><a href="Pix\45th\DSCN9178.JPG"><img
    >> src="Pix\45th\ThumbNails\DSCN9178.jpg"
    >> alt=""/><br/>DSCN9178.JPG</a></p>


    >That doesn't look like a paragraph, it looks more like a list item. Your
    >slashes are backwards. You are using XHTML, but failing to follow the HTML
    >compatibility guidelines. I think a caption is likely to be more useful to
    >the user then the filename.


    I'm going on a wing and a prayer here. First exposure to HTML was a couple
    days ago.... What I wanted was for each link (i.e. the thumbnail and the file
    name) TB stacked vertically. The List format *sounds* more appropriate. I'll
    give it a try and see if it buys me anything presentation-wise.


    My fingers/lower brain stem were following Windows path naming conventions...
    maybe this is the answer to why it failed on the Mac...

    The caption serves me more than the the user. The idea is that a user might
    request an "original" of the picture (not knowing that that .JPEG exists right
    on the CD) and if they are forced to ask by name, it makes it easier to steer
    them to it or, if that seems like fighting nature, just email them the .JPEG.

    --
    PeteCresswell
    (Pete Cresswell), Oct 18, 2004
    #9
  10. (Pete Cresswell)

    Karl Core Guest

    "(Pete Cresswell)" <> wrote in message
    news:...
    > RE/
    >>I'm curious to know if you meant that last word. The alt attribute doesn't
    >>specify an address, it specifies replacement text to display if the image
    >>cannot be rendered (for whatever the reason - some are below).

    >
    > It was pure ignorance. I had just read about "text" and figured "alt"
    > must be
    > something like "Alternative Address Reference".
    >


    It is for this reason that you should familiarize yourself with the basics
    before coming to a newsgroup to ask such questions.
    Regular posters to usenet newsgroups such as this don't have a very
    favorable response to newbies who ask questions that can be answered quite
    easily by doing your own legwork beforehand.

    -Karl
    Karl Core, Oct 18, 2004
    #10
  11. (Pete Cresswell)

    Neal Guest

    On Mon, 18 Oct 2004 01:49:03 GMT, (Pete Cresswell) <> wrote:

    > I'm going on a wing and a prayer here. First exposure to HTML was a
    > couple
    > days ago....


    I remember those days. Don't be offended when i say it's a long, long road
    and you have a lot of work to do!

    > What I wanted was for each link (i.e. the thumbnail and the file
    > name) TB stacked vertically. The List format *sounds* more
    > appropriate. I'll
    > give it a try and see if it buys me anything presentation-wise.


    Don't even worry about presentation in HTML. Use HTML to describe what the
    text IS. Then use CSS to manipulate the presentation. I mean it. Avoid the
    mistakes I've made, please.

    > My fingers/lower brain stem were following Windows path naming
    > conventions...
    > maybe this is the answer to why it failed on the Mac...
    >
    > The caption serves me more than the the user. The idea is that a user
    > might
    > request an "original" of the picture (not knowing that that .JPEG exists
    > right
    > on the CD) and if they are forced to ask by name, it makes it easier to
    > steer
    > them to it or, if that seems like fighting nature, just email them the
    > .JPEG.


    Well, you can make that available. The alt text should, still, be a
    replacement for that odd time when a user cannot see the image.
    Neal, Oct 18, 2004
    #11
  12. RE/
    >Don't even worry about presentation in HTML. Use HTML to describe what the
    >text IS. Then use CSS to manipulate the presentation. I mean it. Avoid the
    >mistakes I've made, please.


    After reading various posts here, I've committed to two things:

    1) Using CSS exclusively.

    2) Getting all my code past the W3 Validators.


    >Well, you can make that available. The alt text should, still, be a
    >replacement for that odd time when a user cannot see the image.


    I think I'll just rewrite the VB routine that generates those links so it plugs
    the file path into 'alt='.

    --
    PeteCresswell
    (Pete Cresswell), Oct 18, 2004
    #12
  13. (Pete Cresswell) wrote:
    > I think I'll just rewrite the VB routine that generates those links so it plugs
    > the file path into 'alt='.


    How will that replace the contents of the image?
    Leif K-Brooks, Oct 18, 2004
    #13
  14. (Pete Cresswell)

    Neal Guest

    On Mon, 18 Oct 2004 13:13:31 GMT, (Pete Cresswell) <> wrote:


    >> Well, you can make that available. The alt text should, still, be a
    >> replacement for that odd time when a user cannot see the image.

    >
    > I think I'll just rewrite the VB routine that generates those links so
    > it plugs
    > the file path into 'alt='.


    Better - reserve alt for its purpose, and insert as a sort of caption to
    the image the filename and other pertinents. You can also include that in
    the title, though users can't copy and paste it from there so easily.
    Neal, Oct 18, 2004
    #14
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Spencer

    Re: Link Link Link DANGER WILL ROBINSON!!!

    Kevin Spencer, May 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    808
    Kevin Spencer
    May 17, 2005
  2. PJ6
    Replies:
    10
    Views:
    903
  3. Paul Furman

    alt tag for an anchor link?

    Paul Furman, Feb 12, 2004, in forum: HTML
    Replies:
    13
    Views:
    43,648
    JohnNotion
    Apr 13, 2012
  4. Les Caudle
    Replies:
    5
    Views:
    373
    Hans Kesting
    Sep 18, 2006
  5. =?Utf-8?B?SXJ3YW5zeWFo?=
    Replies:
    4
    Views:
    2,449
    =?Utf-8?B?SXJ3YW5zeWFo?=
    Oct 30, 2007
Loading...

Share This Page