Nested ordered lists with different start counter - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL Element

Description

Nested ordered lists with different start counter

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 {<!--from w w w. ja v a  2  s.c o  m-->
   counter-reset:item -2;
}

ol {
   counter-reset:item;
   padding-left:11px;
}

LI {
   display:block
}

LI:before {
   content:counters(item, ".") " ";
   counter-increment:item;
}
</style> 
 </head> 
 <body> 
  <ol id="list"> 
   <li>Lor</li> 
   <li>Lorem 
    <ol> 
     <li>Lorem i</li> 
     <li>Lorem i</li> 
     <li>Lorem ips</li> 
    </ol> </li> 
   <li>Lorem</li> 
   <li>Lorem 
    <ol> 
     <li>Lorem ip</li> 
     <li>Lorem ipsu 
      <ol> 
       <li>Lorem ipsum </li> 
       <li>Lorem ipsum </li> 
      </ol> </li> 
    </ol> </li> 
   <li>Lore</li> 
  </ol>  
 </body>
</html>

Related Tutorials