Defining TH with a class, is this possible?

Picked up a CSS project for friends to help. I am not an expert in CSS, here it is:

I can not find a direct answer. I am creating a table and I want two types of TH class that use differnet background color in the table.

(I may also need help with the DIV tag)

The css I'm using, so can someone tell me what I'm doing wrong?

<div class="one"><div class="two"> <table> <TR><TH> one color </TH></TR> <TR><TH class="color">differnet color </TH></TR> </table></div></div> .one .two th { padding: 5px 10px; border: 1px solid #d9d9d9; background: #000000; } .one .two th .color{ padding: 5px 10px; border: 1px solid #d9d9d9; background: #ffffff; } 
+6
source share
1 answer

Remove the space between th and .color

Otherwise, you are looking for a child element .color inside th , and not for the class of th itself.

+12
source

All Articles