Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: <alt> vs <title>

  1. #1
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default <alt> vs <title>

    i've noticed that when i use the <alt> tag and rollover an image the alternative text doesn't show up, it only show's up when i use the <title> tage... do i need to be using both?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    According to the standard, alt is required. It may be empty though:

    Code:
    alt=""
    Except for IE, no browser uses alt as a rollover tip. If there is a title specified, IE will use the title. If there is an alt and an empty title, IE will show no rollover tip.

    IE is the exception but, as long as you follow the standard, you will be OK:

    Provide alternate content (text) for images using the alt attribute. This will only be used if the image is missing or someone is using a browser for the blind or a text only browser - except in IE where it will be a tip if no title (even an empty one) is specified. Use an empty alt attribute if the image is purely decorative.

    Provide rollover tips, if desired, with the title attribute.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    So should I porvide both or is that overkill?

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    The alt attribute is required. The title attribute is optional. I already explained how these two work. It is up to you (what effects you want) how you use them. Just make sure to at least have an empty alt attribute.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    In short:
    1. alt gives you validation
    2. title gives you a rollover message
    (3. alt gives you a rollover message in IE only, only if title is missing)
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  6. #6
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    4. alt is designed for people with disabilities, so they can have a brief description of the image.
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  7. #7
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Sorta. It's the alternate to the image, to describe it if needed.... for those without vision, for when the image doesn't load, is corrupt, and other situations.

    I believe, though, that title also would suffice for some of this, in that a screenreader for the blind would likely find that important, especially if alt was blank or missing.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  8. #8
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Random Google Result:
    In HTML authoring, there are very good reasons to include an alt attribute into every img element. The purpose is to specify a textual replacement for the image, to be displayed or otherwise used in place of the image. Thus, the prime rule is: Consider what the page looks like or sounds like when images are not shown. Then, write for each image an alt text that best works as a replacement. This document also gives more specific suggestions for simple, common situations, and some uncommon too. For content-rich images, it recommends explicit links to textual alternatives.
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  9. #9
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    So then should you use both <alt> and <title>??

  10. #10
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Well, it is up to you.

    Another Google Result:
    The title attribute is intended to provide supplementary information about an element; for example, it might be used to provide extra information about the target of a link. Although the User Agent Accessibility Guidelines (UAAG) requires access to all content, current user agents provide very poor access to title text information, and what access they do provide is typically inaccessible for people with disabilities.
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

Bookmarks

Posting Permissions

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