After Google and stackoverflow-ing , I still could not solve this problem:
I have a table with about a dozen rows. One of the lines looks like this:
<tr class="rvw-product-total"> <td colspan="2"></td> <td>Total:</td> <td>$180.67</td> </tr>
The last two TDs on this line (Total and $ 180.67) should have green text background-color and bold .
So, I can do it in CSS / LESS as follows:
tr[class="rvw-product-total"]:last-child td, tr[class="rvw-product-total"]:nth-child(n+2) td { font-weight: bold; background-color: #DFF0D8; }
This makes the background-color whole line green.
Then I tried to explicitly set the background-color first TD to white, for example:
tr[class="rvw-product-total"]:first-child td { background-color: #fff; }
But the whole line remains green background-color , and I'm just wondering what am I doing wrong here?
Here is a quick demo on jsfiddle: http://jsfiddle.net/acegyver/EYVvc/2/
source share