Nav menu will aligned to center - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu

Description

Nav menu will aligned to center

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 {<!--from  w ww .j a  v a  2s  . c o  m-->
   margin:16px 0px;
   text-align:center;
}

nav .wrap-nav {
   height:81px;
   background:black;
}

.menu ul {
   list-style:none;
   margin:0;
   padding:0;
   display:inline-block
}

.menu  ul li {
   position:relative;
   float:left;
   background-color:Chartreuse;
   padding:7px 6px 0px 6px;
   margin:18px;
}

.menu  ul li:hover {
   background:yellow;
}

.menu  ul li a {
   font-size:17px;
   line-height:21px;
   color:blue;
   display:block;
   padding:7px 11px;
   margin-bottom:6px;
   z-index:7;
   position:relative;
   text-transform:uppercase;
}

.menu  ul li:hover a {
   color:pink;
}

.menu .current {
   background:OrangeRed;
}

.menu .current a {
   color:grey;
}

.minimenu {
   display:none;
}

.minimenu {
   position:relative;
   margin:0px;
   background:BlueViolet;
   border:2px solid Chartreuse;
}

.minimenu div {
   overflow:hidden;
   position:relative;
   font:19px/41px 'Open Sans';
   color:yellow;
   text-align:center;
   text-transform:uppercase;
   font-weight:bold;
}

.minimenu select {
   position:absolute;
   font:19px/41px 'Open Sans';
   color:blue;
   text-align:center;
   text-transform:uppercase;
   font-weight:bold;
   top:0px;
   left:0px;
   width:100%;
   height:100%;
   opacity:0;
   filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);
   cursor:pointer;
}
</style> 
 </head> 
 <body> 
  <nav> 
   <div class="wrap-nav zerogrid"> 
    <div class="menu menucentre"> 
     <ul> 
      <li class="current"> <a class="current" href="index.html">Lore</a> </li> 
      <li> <a href="one.html">Lor</a> </li> 
      <li> <a href="two.html">Lor</a> </li> 
      <li> <a href="three.html">Lorem</a> </li> 
      <li> <a href="four.html">Lore</a> </li> 
     </ul> 
    </div> 
    <div class="minimenu"> 
     <div>
       Lorem 
     </div> 
     <select onchange="location=this.value"> <option></option> <option value="index.html">Lorem i</option> <option value="one.html">Lorem </option> <option value="two.html">Lorem </option> <option value="three.html">Lorem ip</option> <option value="four.html">Lorem i</option> </select> 
    </div> 
   </div> 
  </nav>  
 </body>
</html>

Related Tutorials