Center the menu in the middle of page - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu

Description

Center the menu in the middle of page

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">
div.menu {
   list-style:none;
   margin:0;
   padding:0;
   width:100%;
   text-align:center;
}

div.menu ul {
   font-family:Verdana;
   font-size:15px;
   margin:21px;
   padding:0;
   display:inline-block;
}

div.menu li {
   display:inline;
}

div.menu li a {
   text-decoration:none;<!-- w w  w .  ja v  a2s.  c  o m-->
   padding:6px 0;
   width:100px;
   background:Chartreuse;
   color:yellow;
   float:left;
   text-align:center;
   border-left:2px solid blue;
}

div.menu li a:hover {
   background:pink;
   color:OrangeRed;
}
</style> 
 </head> 
 <body> 
  <div class="menu"> 
   <ul> 
    <li> <a href="">Lorem</a> </li> 
    <li> <a href="">Lorem</a> </li> 
    <li> <a href="">Lorem</a> </li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials