HTML CSS examples for CSS Selector:nth-child
Combining CSS pseudo-classes nth-child and not
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> tr:first-child, tr:nth-child(2n+4) { background-color:Chartreuse; } </style> <!-- w w w .jav a 2 s . com--> </head> <body> <table> <tbody> <tr> <td>Lorem </td> </tr> <tr> <td>Lorem </td> </tr> <tr class="openingTimes"> <td>Lorem ipsum dolor</td> </tr> <tr> <td>Lorem </td> </tr> <tr> <td>Lorem </td> </tr> <tr> <td>Lorem </td> </tr> <tr> <td>Lorem </td> </tr> </tbody> </table> </body> </html>