Forum Moderators: open

Message Too Old, No Replies

HTML Strict

background element in <td>

         

protools

4:37 pm on Jan 10, 2007 (gmt 0)

10+ Year Member



Hi, I have a background element in a tag

td width="183" rowspan="2" align="left" valign="top" background="../assets/images/left_r2_c1.jpg"

my doctype is

!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"

The validation error states:
"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."

Does anyone know what need to do to achieve validation, other than changing the doctype. That particular doctype is needed due to one of my menus.

tia
barbara

jimbeetle

5:26 pm on Jan 10, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Welcome to WebmasterWorld, Barbara.

I'm pretty sure the problem is that "background" is not a valid attribute to use with TD.

If you plug an inline style into your TD element it should work:

<td>style="background: url(myimage.jpg);" ... </td>

protools

5:45 pm on Jan 10, 2007 (gmt 0)

10+ Year Member



thanks, that worked, and validated.