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

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -