Counter for three level nested ordered list - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL Element

Description

Counter for three level nested ordered list

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">
ol {<!--  w w w  .  j  a va2s.  c  o  m-->
   counter-reset:item
}

li {
   display:block
}

li:before {
   content:counters(item, ".") " ";
   counter-increment:item
}
</style> 
 </head> 
 <body> 
  <ol> 
   <li>Lorem 
    <ol> 
     <li>Lore</li> 
     <li>Lore</li> 
    </ol> </li> 
   <li>Lorem 
    <ol> 
     <li>Lore</li> 
     <li>Lore</li> 
     <ol> 
      <li>Lore</li> 
      <li>Lore</li> 
     </ol> 
    </ol> </li> 
   <li>Lorem</li> 
  </ol>  
 </body>
</html>

Related Tutorials