CSS :nth-of-type(4n+4) - HTML CSS CSS Selector

HTML CSS examples for CSS Selector:nth-of-type

Description

CSS :nth-of-type(4n+4)

Demo Code

ResultView the demo in separate window

<html lang="en">
 <head> 
  <style>
ul {<!--  ww  w. j av  a2s  .  c  om-->
   overflow:hidden;
   width:301px;
}

ul li {
   width:151px;
   float:left;
   background:Chartreuse;
}

ul li:nth-of-type(4n+4) {
   background:yellow;
}

ul li:nth-of-type(4n+3) {
   background:blue;
}
</style> 
 </head> 
 <body translate="no"> 
  <ul> 
   <li>Lorem</li> 
   <li>Lor</li> 
   <li>Lor</li> 
   <li>Lorem</li> 
   <li>Lorem</li> 
   <li>Lor</li> 
   <li>Lor</li> 
   <li>Lorem</li> 
   <li>Lorem</li> 
   <li>Lor</li> 
  </ul>  
 </body>
</html>

Related Tutorials