HTML CSS examples for CSS Selector:nth-child
Select the 5th child element
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> p:nth-child(n+6)<!--from w w w . jav a2s. co m--> { background:Chartreuse; } </style> </head> <body> <h1>Lorem ipsum dolor</h1> <p>Lorem ipsum dolor si</p> <p>Lorem ipsum dolor sit</p> <p>Lorem ipsum dolor si</p> <p>Lorem ipsum dolor sit</p> <p>Lorem ipsum dolor si</p> <p>Lorem ipsum dolor si</p> <p>Lorem ipsum dolor sit </p> <p>Lorem ipsum dolor si</p> <p>Lorem ipsum dolor si</p> <p> <b>Lorem</b>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie </p> </body> </html>