center UL list - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL Element

Description

center UL 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">
#listwrapper<!--  ww  w .  ja v a2s  .c om-->
 {
   margin:auto;
   text-align:center;
}

#list
 {
   margin:auto;
   background-color:Chartreuse;
}

.list--reset
 {
   padding-left:0;
}

#list li
 {
   display:inline;
   background-color:yellow;
}
</style> 
 </head> 
 <body> 
  <div id="listwrapper"> 
   <h3>Lorem ipsum dolor</h3> 
   <ol id="list"> 
    <li> <a href="">Lorem ipsum dolor sit a</a> </li> 
    <li> <a href="">Lorem ipsum dolor sit amet, </a> </li> 
    <li> <a href="">Lorem ipsum dolor sit amet,</a> </li> 
   </ol> 
  </div> 
  <div id="listwrapper"> 
   <h3>Lorem ipsum dolor</h3> 
   <ol id="list" class="list--reset"> 
    <li> <a href="/">Lorem ipsum dolor sit a</a> </li> 
    <li> <a href="">Lorem ipsum dolor sit amet, </a> </li> 
    <li> <a href="/">Lorem ipsum dolor sit amet,</a> </li> 
   </ol> 
  </div>  
 </body>
</html>

Related Tutorials