W3C home > Mailing lists > Public > www-validator@w3.org > August 2002

Re: Validating my HTML code: background= problems

From: Thanasis Kinias <tkinias@optimalco.com>
Date: Tue, 6 Aug 2002 16:24:46 -0700
To: Nick & Kate Nicholes <kghn@ttc-cmc.net>
Cc: www-validator@w3.org
Message-ID: <20020806232446.GA28413@optimalco.com>

scripsit Nick & Kate Nicholes:
 
> However, I am finding inconsistent error flagging behavior regarding the
> use of BACKGROUND="***.jpg".  It validates fine in a <BODY> command, flags
> as an error in <TABLE>, and *sometimes* is flagged as an error in <TD>.  I
> have swapped around similar <TR><TD BACKGROUND="***.jpg">***</TD><TR> table
> sections, and the first occurance is flagged and the second and subsequent
> are not.

There is no 'background' attribute for <table> or <td>, only for <body>.
The validator is correct in flagging this as an error.

> My Netscape 4.73 seems to handle all 3 situations as I would hope/expect,
> using the picture as wallpaper behind any text I specify.

Netscape and MS browsers support a variety of "extensions" to HTML that
are not part of any W3C DTD.  Valid HTML that declares a W3C DTD must
not, therefore, use them.  The 'background' attributes are one example.

> I chose straight HTML 4 without style sheets to try to accomodate a wide
> variety of viewers.  I like to write my code with a plain editor.

If you want to maximise accessibility, you would be far better served to
use HTML 4.01 Strict and CSS.  See the Web Content Accessibility
Guidelines [1].

> I would like some help knowing what is considered correct in HTML 4.  It
> sure is nice to be able to put a picture in a table cell behind my text.

CSS will do the job nicely, while also allowing validity and
accessibility  "background: url(foo.jpg);".

References
1. <http://www.w3.org/TR/WCAG/>

-- 
Thanasis Kinias
Web Developer, Information Technology
Graduate Student, Department of History
Arizona State University
Tempe, Arizona, U.S.A.

Ash nazg durbatulūk, ash nazg gimbatul,
Ash nazg thrakatulūk agh burzum-ishi krimpatul
Received on Tuesday, 6 August 2002 19:24:49 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:03 GMT