CSS select first-of-type among grand children - HTML CSS CSS Selector

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

Description

CSS select first-of-type among grand children

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">
.parent>div:first-of-type>p:first-of-type {
   color:Chartreuse;
}
</style> <!--from ww w  .j  a  v a2  s.  c om-->
 </head> 
 <body> 
  <div class="parent"> 
   <div> 
    <p class="interline">Lore</p> 
    <p class="interline">Lore</p> 
    <p class="interline">Lore</p> 
   </div> 
   <div> 
    <p class="interline">Lore</p> 
    <p class="interline">Lore</p> 
    <p class="interline">Lore</p> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials