SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Nov 2009
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    The alt attribute

    why doesn't the alt attribute work in this code?

    Code:
    <a href="http://www.youtube.com/watch?v=cIKgtlkltHM" rel="vidbox"><img src="http://i4.ytimg.com/vi/cIKgtlkltHM/default.jpg" class="imga" alt="Padre Island" /></a>

  2. #2
    SitePoint Guru
    Join Date
    Nov 2005
    Location
    Norway
    Posts
    715
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Should work fine. What kind of behavior are you experiencing?

  3. #3
    SitePoint Member
    Join Date
    Nov 2009
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well it just doesn't display anything when i put my cursor over it.

  4. #4
    SitePoint Guru
    Join Date
    Nov 2005
    Location
    Norway
    Posts
    715
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is a feature in Internet Explorer only, other browsers threat the alternative text as it should, only displaying it when images are disabled. Add a title attribute to your image instead if you'd like this behavior. Remember to not add the same information in both the alt and title attribute, since it will be read twice by screen readers.

  5. #5
    SitePoint Wizard bronze trophy Black Max's Avatar
    Join Date
    Apr 2007
    Posts
    4,029
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by fredda View Post
    Remember to not add the same information in both the alt and title attribute, since it will be read twice by screen readers.
    I didn't know that. Thanks for the tip!

  6. #6
    SitePoint Member
    Join Date
    Nov 2009
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you i added the title attribute and it works. Thanks for the tip.


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
  •