Forum Moderators: open

Message Too Old, No Replies

Validation error on <img>

Can anyone tell me what is wrong here?

         

Daily Sparring

7:23 pm on Mar 19, 2004 (gmt 0)

10+ Year Member



and had this error returned quite frequently.

<td bgcolor="#000000"><img src="Images/spacer.gif" width="5" height="5"></td>

txbakers

7:24 pm on Mar 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



you need an "alt" attribute for your img tag.

Daily Sparring

7:42 pm on Mar 19, 2004 (gmt 0)

10+ Year Member



I 'need' it? You mean that it is required? What is the purpose of the alt tag? I am not looking for a lesson just a clarification. Thanks for your reply.

skippy

7:50 pm on Mar 19, 2004 (gmt 0)

10+ Year Member



yup alt="" should do the trick

Romeo

7:56 pm on Mar 19, 2004 (gmt 0)

10+ Year Member



yes, it is required by the html-specs, and it is a friendly gesture to tell people (handicapped perhaps) just using text-based browsers like lynx what could be seen on your pictures.
If you don't want to give a short description of your pictures, just an empty alt=" " will comply with the specs.

Regards,
R.

grahamstewart

8:35 pm on Mar 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yep, you should use alt to provide text for people who have images turned off or who are using accessibility software.

If it is a purely decorative image (or a spacer gif) then you should just use an empty alt tag

alt=""
-- only give descriptive text in the alt tag if it is exactly useful (e.g. "red box","spacer" or "our logo" is probably not very useful, whereas something like "new post" or "special deal" is).

tedster

9:54 pm on Mar 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There another issue here - bgcolor is a deprecated attribute [webmasterworld.com] and if you are using a strict DTD, bgcolor is not allowed at all. Even in with transitional DTD you should get a "warning".

CSS background-color rules are the valid way to go.