Forum Moderators: open

Message Too Old, No Replies

Validator issues

         

cablenewt

8:30 pm on Nov 13, 2005 (gmt 0)

10+ Year Member



Hi, I'm having problems with this validation its showing me errors but I don't understand what it is telling me.

I'm using the HTML 4.01 Transitional

Here is the first error I'm getting:

Error Line 50 column 25: there is no attribute "BACKGROUND".


<td width="7" background="layoutimages/menuleft.jpg"></td>

You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute.

And all of the other problems are telling me required attribute "ALT" not specified. But the thing is I don't want all of my images to have alt text.

Thanks for the help.

asquithea

9:16 pm on Nov 13, 2005 (gmt 0)

10+ Year Member



Well, this seems pretty straight-forward.

When the validator says this:

there is no attribute "BACKGROUND"
it means that the TD element cannot have a background attribute.

[w3.org...]

And since all image must have an alt attribute, simply apply an empty attribute to each one.

[w3.org...]

Do not specify irrelevant alternate text when including images intended to format a page, for instance, alt="red ball" would be inappropriate for an image that adds a red ball for decorating a heading or paragraph. In such cases, the alternate text should be the empty string ("").

DanA

9:23 pm on Nov 13, 2005 (gmt 0)

10+ Year Member



the background attribute is deprecated in HTML 4.0
you can use

<td width="7" style="background-image:
url('layoutimages/menuleft.jpg');"></td>

cablenewt

9:53 pm on Nov 13, 2005 (gmt 0)

10+ Year Member



Thanks for the help, All of the errors are gone now.