Select first child of class in different parents - HTML CSS CSS Selector

HTML CSS examples for CSS Selector:element parent child

Description

Select first child of class in different parents

Demo Code

ResultView the demo in separate window


<html>
 <head> 
  <style>
div .labelinput:first-child {
   border-top:2px solid Chartreuse;
}
</style> <!--from w w w  . jav  a  2  s  . c o m-->
 </head> 
 <body> 
  <div class="one"> 
   <div class="labelinput">
     Lorem ipsum 
   </div> 
   <div class="labelinput"></div> 
   <div class="labelinput"></div> 
  </div> 
  <div class="two"> 
   <div class="labelinput">
     Lorem ipsum 
   </div> 
   <div class="labelinput"></div> 
   <div class="labelinput"></div> 
  </div>Lorem 
  <div class="seventeen"> 
   <div class="labelinput">
     Lorem ipsum 
   </div> 
   <div class="labelinput"></div> 
   <div class="labelinput"></div> 
  </div>  
 </body>
</html>

Related Tutorials