Selector for non-immediate child element - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Responsive Media

Description

Selector for non-immediate child element

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">
.main .text {<!--from   www  .j av a2  s  . c o m-->
   background-color:Chartreuse;
}
</style> 
 </head> 
 <body> 
  <div class="main"> 
   <elem class="something"> 
    <elem id="link"> 
     <elem class="otherclass"> 
      <p class="text">Lorem</p> 
     </elem> 
    </elem> 
   </elem> 
  </div>  
 </body>
</html>

Related Tutorials