AlfieWebDevTips Homefor new and experienced developers
[Home Home] [Web Development Web Development ] [Code Generators Code Generators ] [Resources Resources ] [Contact Us Contact ] |WebDevTips Privacy Privacy |
Print This Page

You are here : Home - Resources - FAQ - HTML Q3

FAQ - HTML Q3



Q3: Do I really need the alt tag on a spacer gif?

A:Well yes and no.

First we'll look at yes.

If you want your html to validate then you must provide an alt tag, something like this will do
<img src="images/spacer.gif" width="300" height="2" alt="" border="0">
You won't get any alt text showing and your page will validate.

If you want to validate for web accessibility then you can't leave the tag empty
<img src="images/spacer.gif" width="300" height="2" alt="image spacer" border="0">
You must provide text to validate for web accessibility.

If you don't care about either of the above then hang your head in shame :)
<img src="images/spacer.gif" width="300" height="2" border="0">
This will work if you don't want to validate your page.


back to faq




Google
 

[back to top of page]   

[labelled with icra -  - this link will open in a new window] [RSS Content]

[Copyright © WebDevTips]