Number a list - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL Element

Description

Number a 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. ja  va2 s . c o  m-->
   counter-reset:section;
   list-style-type:none;
}

ol li {
   counter-increment:section;
}

ol li:before {
   content:counters(section, ".") ". ";
}
</style> 
 </head> 
 <body> 
  <ol> 
   <li>Lorem ip 
    <ol> 
     <li>Lorem ipsu</li> 
     <li>Lorem ipsu</li> 
    </ol> </li> 
   <li>Lorem ip 
    <ol> 
     <li>Lorem ipsu</li> 
     <li>Lorem ipsu</li> 
    </ol> </li> 
  </ol>  
 </body>
</html>

Related Tutorials