customize unordered lists position - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Position

Description

customize unordered lists position

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  ww  . ja  va  2s  .com-->
   list-style:none;
   padding:0;
   margin:0;
}

ol li {
   counter-increment:step-counter;
   background:lightgreen;
   padding:21px 21px 21px 51px;
   margin-bottom:9px;
   position:relative;
}

ol li:before {
   content:counter(step-counter) ".";
   position:absolute;
   left:21px;
}
</style> 
 </head> 
 <body> 
  <ol> 
   <li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulum tortor neque, ornare vitae tempor hendrerit, luctus at neque. Phasellus sed quam pharetra, t</li> 
   <li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulum tortor neque, ornare vitae tempor hendrerit, luctus at neque. Phasellus sed quam pharetra, t</li> 
   <li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulum tortor neque, ornare vitae tempor hendrerit, luctus at neque. Phasellus sed quam pharetra, t</li> 
  </ol>  
 </body>
</html>

Related Tutorials