choose second and third element (li) in <ul> tag - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL Element

Description

choose second and third element (li) in <ul> tag

Demo Code

ResultView the demo in separate window

<html lang="en">
 <head> 
  <style>
li:nth-child(n+2):nth-child(-n+3) {
   margin-right:51px;
   color:Chartreuse;
}
</style> <!--from   w  w  w  . j  a  v  a  2s  .  c om-->
 </head> 
 <body translate="no"> 
  <ul> 
   <li>L</li> 
   <li>L</li> 
   <li>L</li> 
   <li>L</li> 
   <li>L</li> 
   <li>L</li> 
  </ul>  
 </body>
</html>

Related Tutorials