html - Changing color of table row by a class in tr -
i want change background color of td in tr using class in tr. using following css
tr .yellow td{ background-color: yellow; }
and have following html
<tr class="yellow"><td></td> <td></td></tr> but background color not changing. mistake here?
you have space before class in css declaration
tr.yellow td{ background-color: yellow; } you need remove space indicate class on <tr> element. without suggesting hierarchy is:
tr, class of "yellow", td
e.g.
<tr> <sometag class="yellow"> <td> which isn't dom looks like.
Comments
Post a Comment