Nth-child(even) for a css class - HTML CSS CSS Selector

HTML CSS examples for CSS Selector:nth-child

Description

Nth-child(even) for a css class

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">
.wrap-well div.story:nth-of-type(even) {
   background-color:Chartreuse;
}
</style> <!--from w w w .  ja  v  a  2s. c o m-->
 </head> 
 <body> 
  <div class="wrap-well"> 
   <div class="story">
     Lorem 
   </div> 
   <div class="story">
     Lorem 
   </div> 
   <br class="clearfix"> 
   <div class="story">
     Lorem 
   </div> 
   <div class="story">
     Lorem 
   </div> 
   <br class="clearfix"> 
   <div class="story">
     Lorem 
   </div> 
   <div class="story">
     Lorem 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials