Why, when using http://validator.w3.org/, am I getting the validation error shown below, within this code segment <table width="1000" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="100" height="138" background="images/homepage7box.png"> </td> <td width="230" height="138" background="images/homepage8box.png"> </td> <td width="670" height="138" background="images/homepage9box.png"> </td> </tr> </table> BTW, using <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> changing DOCTYPE's just makes it worse. TIA VALIDATION ERROR ----------------------------------------------------------------------- Line 52, Column 45: Attribute "background" exists, but can not be used for this element. <td width="100" height="138" background="images/homepage7box.png"></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. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash. -----------------------------------------------------------------------
It's pretty much like the error says, you cannot use the background property like that. The best solution here is to use an ID or class selector in combination with the CSS background property like so: <table id = "tableStyle" width="1000" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="100" height="138"> </td> <td width="230" height="138"> </td> <td width="670" height="138"> </td> </tr> </table> HTML: and then in your stylesheet add the following: #tableStyle td{ background: url('images/homepage9box.png');/*may need to change the path here*/ } Code (markup): although unless your stylesheet is in the same directory as your html file, you will need to change the path to your background image as it is relative to where the stylesheet is located.