dcsimg
www.webdeveloper.com
Results 1 to 7 of 7

Thread: How valid is it to have a null alt?

  1. #1
    Join Date
    May 2004
    Posts
    442

    How valid is it to have a null alt?

    Writing a replacement for a popup window, that uses a text box created with css, that "pops up" when you hover over a graphic. It all works great, except the alt text pops up along with the css text box containing my info. Anyway, the only way to get rid of the alt text box and avoid an html error is to have alt=""
    But my question is, is this an acceptable thing to do? To set alt to null? Or is it better to just give up this line of thought and use the alt text to display my message?

  2. #2
    Join Date
    Jan 2005
    Location
    Frankfort, KY, USA
    Posts
    6,167
    The alt text is there to describe the image, for when it fails to download or the viewer is visually impaired. Alt text is an accessibility concern and shouldn't be sacrificed for a design.

    FYI - search engines index the information in the alt tags, especially Google.

    Good Luck -
    KDLA

  3. #3
    Join Date
    Mar 2006
    Location
    Newcastle NSW Australia
    Posts
    4,033
    The alt text SHOULDN'T pop up - this is incorrect behaviour by IE, and can be annoying. The title tag should be the only one that pops up (as in FF). The blank alt tag is quite common, and it is up to you whether accessibility or design is the major concern.

    Cheers
    Graeme

  4. #4
    Join Date
    May 2004
    Posts
    442
    Thank you. Great set of answers!
    Clearly if the alt text is not supposed to appear, I should not use it for critical information anyway. So, css is a better way to go. I think that setting the alt to null on this ocassion is acceptable.

  5. #5
    Join Date
    Mar 2005
    Location
    Sydney, Australia
    Posts
    7,974
    To fix the bug in IE so that the alt text doesn't appear define an empty title attribute.

    <img src="myimg.gif" width="100" height="200" alt="description of the image to display if the image isn't displayed" title="">

    There should never be a need for an image with alt="" because that is basically saying that the image isn't needed for the page at all.

  6. #6
    Join Date
    Jun 2005
    Location
    United Kingdom
    Posts
    1,043
    Quote Originally Posted by Centauri
    ...........The blank alt tag is quite common, and it is up to you whether accessibility or design is the major concern.

    Cheers
    Graeme
    In the UK accessibility is every web designers concern under the DDA. In Australia, a site was fined for failing to provide alt tags. Such cases are rare. Nevertheless, in some countries it not just "up to you" to design for accessibility, as far as the law is concerned. And it seems that search engines favour the use of alt tags.

  7. #7
    Join Date
    Jun 2005
    Location
    United Kingdom
    Posts
    1,043
    Quote Originally Posted by felgall
    ...........There should never be a need for an image with alt="" because that is basically saying that the image isn't needed for the page at all.
    I believe that cosmetic images that are mere decoration should have alt="" . I also think there is a case for logos to have alt="" as well. As far as a reader is concerned, they are cosmetic. Leaving a null value for them spares a listener the tedium of hearing something like "company logo" on each page.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles