apply last-child only for first nested li - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL Element

Description

apply last-child only for first nested li

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">
ul.main>li>ul>li:first-child>a {
   background:green;
}
</style> <!--   ww  w  .  ja v a 2 s.  c om-->
 </head> 
 <body> 
  <ul class="main"> 
   <li>Lorem ipsum d 
    <ul> 
     <li> <a>Lorem ipsum</a> 
      <ul> 
       <li> <a>Lorem ipsum d</a> </li> 
      </ul> </li> 
    </ul> </li> 
  </ul>  
 </body>
</html>

Related Tutorials