Center aligning the top menu categories - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu

Description

Center aligning the top menu categories

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">
body {<!--  ww w. ja  v  a2s.  com-->
   margin:0;
   padding:0;
}

ul {
   margin-left:0;
   display:table;
   table-layout:fixed;
   width:100%;
   text-align:center;
}

ul,li {
   list-style:none;
   padding:0;
}

.navigationbarcollectioncomponent {
   width:1201px;
   margin:0 auto;
}

#nav_main {
   margin:0  auto;
   display:table;
}

#nav_main li.La {
   display:table-cell;
}

#nav_main li.La>a {
   color:Chartreuse;
   display:inline-block;
   font-family:"Lato-Regular";
   font-size:17px;
   line-height:37px;
   margin:0;
   padding:0px 9px;
   text-transform:uppercase;
}
</style> 
 </head> 
 <body> 
  <div class="navigationbarcollectioncomponent"> 
   <div id="nav_main"> 
    <ul> 
     <li class="La parent"> <a href="">Lorem ip</a> </li> 
     <li class="La parent"> <a href="">Lorem</a> </li> 
     <li class="La parent"> <a href="">Lorem ipsum</a> </li> 
     <li class="La parent"> <a href="">Lorem ipsum dolor</a> </li> 
     <li class="La parent"> <a href="">Lore</a> </li> 
     <li class="La parent"> <a href="">Lorem ipsu</a> </li> 
    </ul> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials