UL LI horizontal positioned center aligned - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL Alignment

Description

UL LI horizontal positioned center aligned

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">
#menu-outer {<!--from   w  ww  .jav a2  s  .  c om-->
   height:85px;
   background:url('https://www.java2s.com/style/demo/Google-Chrome.png') repeat-x;
}

.table {
   display:table;
   margin:0 auto;
}

ul#horizontal-list {
   min-width:697px;
   list-style:none;
   padding-top:21px;
}

ul#horizontal-list li {
   background:url('https://www.java2s.com/style/demo/Google-Chrome.png') top no-repeat;
   display:inline-block;
   margin:0 11px;
   text-align:center;
   vertical-align:top;
}

a {
   color:Chartreuse;
}
</style> 
 </head> 
 <body> 
  <div id="menu-outer"> 
   <div class="table"> 
    <ul id="horizontal-list"> 
     <li> <a href="#">Lorem ipsum</a> <br>Lorem ipsum</li> 
     <li> <a href="#">Lorem ipsum</a> <br>Lorem ipsum</li> 
     <li> <a href="#">Lorem ipsum</a> <br>Lorem ipsum</li> 
     <li> <a href="#">Lorem ipsum</a> <br>Lorem ipsum</li> 
    </ul> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials