Selecting a list item without a sublist - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL Element

Description

Selecting a list item without a sublist

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">
.list>li>a:only-child {
   color:Chartreuse;
}
</style> <!--  www . ja  v a2  s. co m-->
 </head> 
 <body> 
  <ul class="list"> 
   <li> <a href="#">Lore</a> </li> 
   <li> <a href="#">Lore</a> 
    <ul> 
     <li>Lorem</li> 
    </ul> </li> 
  </ul>  
 </body>
</html>

Related Tutorials