

Ask HN: How can I target 2nd and last row of every tbody in pure CSS? - Stratoz

Here is my puzzle: http:&#x2F;&#x2F;jsfiddle.net&#x2F;gMqJL&#x2F;<p>The rows that say &quot;(Red)&quot; should have the &quot;red&quot; class. I can do it in jQuery but not sure how to do it in pure CSS (without dirtying the markup).
======
Stratoz
Ack, nevermind I just figured it out.

#table > tbody > tr:nth-child(2), #table > tbody > tr:last-child { color:
#ff0000; }

------
bdfh42
Having excluded the two obvious ways of solving the problem...

