HTML CSS examples for CSS Selector:nth-child
Select multiple child elements using nth-child
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .one ul li:nth-child(-n+5) { color:Chartreuse; } </style> <!-- www. j a v a 2 s . c o m--> </head> <body> <div class="one"> <ul> <li>Lor</li> <li>Lor</li> <li>Lorem</li> <li>Lore</li> <li>Lore</li> <li>Lor</li> <li>Lorem</li> <li>Lorem</li> <li>Lore</li> <li>Lor</li> </ul> </div> </body> </html>