HTML CSS examples for CSS Selector:nth-child
Using nth-child to make a chess pattern
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> ul>li { float:left; width:51%; height:201px; margin:0; background:Chartreuse; } li:nth-child(4n-2), li:nth-child(4n-1) { background:black; } </style> <!--from ww w . ja v a 2s. c o m--> </head> <body> <ul class="list-offers list-column"> <li></li> <li class="highlight"></li> <li class="highlight"></li> <li></li> <li></li> <li class="highlight"></li> <li class="highlight"></li> <li></li> <li></li> <li class="highlight"></li> </ul> </body> </html>