user605334
user605334

Reputation:

how to use table tr:odd td in html

When I define this CSS in HTML I found that they not show me even in Firebug but I see after edit button Firebug CSS panel [tab]

#tbl tr:odd td{
    background: none repeat scroll 0 0 #FFFFFF;
}

well I want to make tr's background color #FFF.

Upvotes: 3

Views: 20138

Answers (1)

Frédéric Hamidi
Frédéric Hamidi

Reputation: 262979

According to CSS3, even and odd are actually arguments to the :nth-child() pseudo-class, not selectors in their own right. Try:

#tbl tr:nth-child(odd) td {
    background: none repeat scroll 0 0 #FFFFFF;
}

Of course, your browser has to support CSS3 for the above to work.

Upvotes: 20

Related Questions