HTML CSS examples for CSS Widget:Color
Color every other row black using :nth-child(odd)
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> div.dataset:nth-child(odd) { background: black; color:white; } </style> </head> <!-- w w w . j ava 2 s . com--> <body> <div class="container"> <div class="dataset"> Thomas Jones </div> <div class="dataset"> Edward Jones </div> <div class="dataset"> Tommy Lee </div> <div class="dataset"> Jenna Haze </div> </div> </body> </html>