[thelist] css: background-color

Joxn joxn at vernum.com
Tue Oct 1 08:05:00 CDT 2002


Hi folks,
I output a list in alternating background colors per row. The first one
has a white background, the second a grey background and the third a
white one again.

I used to do this by simply setting either <tr bgcolor="white"> or <tr
bgcolor="grey"> after checking with PHP which row I am in.

Well, since switching to CSS I can't seem to get it right.

I tried the following:

tr1
{
  background-color	: #FFFFFF;
}
tr2
{
  background-color	: #DCDCDC;
}

However, as I understand the CSS spec, the background-color is not
automatically inherited.

Then I added the following class to the <td> elements:
td.content
{
  background-color	: inherit;
}

But with no luck...

Is there an easy way with CSS to create the same result as before? Am I
overlooking something?

TIA,
Joxn
--
    || //\\ \\// |\\||  ::  joxn at vernum.com  ::
  \\|| \\// //\\ ||\\|  ::      8053703      ::




More information about the thelist mailing list