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>
| SitePoint Sponsor |
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>




Should work fine. What kind of behavior are you experiencing?
well it just doesn't display anything when i put my cursor over it.




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.
Thank you i added the title attribute and it works. Thanks for the tip.
Bookmarks