Making horizontal menu to the center of the div - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu

Description

Making horizontal menu to the center of the div

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">
.nav {<!-- w w  w .  j a v  a 2  s  .co  m-->
   border:2px solid Chartreuse;
   border-width:2px 0;
   list-style:none;
   margin:0 auto;
   padding:21px 0;
   width:100%;
   text-align:center;
}

ul.nav-menu {
   list-style:none;
   padding:0;
   font-size:15px;
   line-height:15px;
   font-family:'latoregular';
   margin:0 auto;
   display:inline-block;
   text-align:center;
}

ul.nav-menu:after {
   content:"";
   clear:both;
   display:block;
   overflow:hidden;
   visibility:hidden;
   width:0;
   height:0;
}

ul.nav-menu li {
   float:left;
   margin:0 0 0 11px;
   position:relative;
}

ul.nav-menu li:first-child {
   margin:0;
}
</style> 
 </head> 
 <body> 
  <div class="nav"> 
   <ul class="nav-menu"> 
    <li> <a href="#" class="selected">Lorem </a> </li> 
    <li> <a href="#">Lorem ipsum</a> </li> 
    <li> <a href="#">Lorem </a> </li> 
    <li> <a href="#">Lorem ips</a> </li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials