Center li elements inside ul list - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL Element

Description

Center li elements inside 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">
.all-collections {<!-- ww w.  j  a v a  2  s.  c o m-->
   text-align:center;
}

.all-collections ul {
   list-style:none;
   margin:0 auto;
   width:41%;
   text-align:center;
}

.all-collections ul li {
   display:inline-block;
}
</style> 
 </head> 
 <body> 
  <div class="all-collections"> 
   <h1>Lorem ipsum dolor sit a</h1> 
   <ul> 
    <li> <a href="#">Lorem </a> </li> 
    <li> <a href="#">Lorem ipsum do</a> </li> 
    <li> <a href="#">Lorem i</a> </li> 
    <li> <a href="#">Lorem ip</a> </li> 
    <li> <a href="#">Lorem ipsu</a> </li> 
    <li> <a href="#">Lorem</a> </li> 
    <li> <a href="#">Lorem </a> </li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials