use nth-child in CSS to select all elements after the 3rd one - HTML CSS CSS Selector

HTML CSS examples for CSS Selector:nth-child

Description

use nth-child in CSS to select all elements after the 3rd one

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
p:nth-child(1n+4)
 {
   background:Chartreuse;
}
</style> <!--from   w  w  w  .j a va2  s  .  c o m-->
 </head> 
 <body> 
  <p>L</p> 
  <p>L</p> 
  <p>L</p> 
  <p>L</p> 
  <p>L</p> 
  <p>L</p> 
  <p>L</p>  
 </body>
</html>

Related Tutorials