Sent by Eric A. Meyer on 19 February 2002 08:08
At 16:14 -0600 2/18/02, [EMAIL-REMOVED] wrote:
>Have table cells which have a backgorund color specified on the table
>itself. Want to override that color using CSS, but just want to make the
>background color GoAway. IOW, have a tag with 'tr bgcolor="#FFF"' in it,
>and I want to put a tr entry in the CSS file which removes that color, and
>lets the page background show through.
>
>I've tried specifying a background-color:transparent in the CSS, but that
>doesn't appear to work. Is there any way?
In theory, yes, but it probably depends on the browser. You ought
to be able to make this happen like so:
tr, tr td {background-color: transparent;}
If the browser implements CSS2:6.4.4 correctly[1], the style above
will override the inline HTML formatting. Some browsers, however,
treat HTML-based presentation the same as 'style' attributes, which
is wrong and will also prevent you from ever overriding the 'bgcolor'
value.
You didn't say which browser(s) were giving you trouble, so it's
hard to guess if that's the problem or not. It sounds like it might
be.
[1]<http://www.w3.org/TR/REC-CSS2/cascade.html#q12>
--
Eric A. Meyer (http://www.meyerweb.com/eric/), List Chaperone
"CSS is much too interesting and elegant to be not taken seriously."
-- Martina Kosloff