Select first class which after a specific class - HTML CSS CSS Selector

HTML CSS examples for CSS Selector:after

Description

Select first class which after a specific 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 .box:nth-of-type(1) {<!--  ww w  .  ja  va  2 s .c o m-->
   background:red;
}
</style> 
 </head> 
 <body> 
  <div class="wrap"> 
   <div class="box">
     Lorem ipsum dolor sit ame 
   </div> 
   <p>Lorem </p> 
   <div class="box">
     Lorem ipsum dolor sit amet, cons 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials