Just need help in writing a CSS selector. I want to select the last element of the below that has a class of RED
#tData td:nth-child(8)
I can't seem to figure out how to attache the RED class to the selector.
Just need help in writing a CSS selector. I want to select the last element of the below that has a class of RED
#tData td:nth-child(8)
I can't seem to figure out how to attache the RED class to the selector.
#tData td.red:nth-child(8) {}
will select any 8th cell in its row, if the cell has "red" class, inside #tData
.
If you want to select the last element in the <tr>
, if that last element has the class of "red", use:
#tData td.red:last-child {}