Centering a css menu - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu

Description

Centering a css menu

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">
#navlist<!--   w ww  .j  a  v a 2  s .c  o  m-->
 {
   margin:auto;
   padding:16px 0 21px 11px;
   width:551px;
}

#navlist ul, #navlist li
 {
   margin:0;
   padding:0;
   display:inline-block;
   list-style-type:none;
}

#navlist a:link, #navlist a:visited
 {
   float:left;
   line-height:15px;
   font-family:'Chivo', Helvetica, Arial, sans-serif;
   margin:0 11px 5px 31px;
   text-decoration:none;
   color:Chartreuse;
}

#navlist a:link#current, #navlist a:visited#current, #navlist a:hover
 {
   padding-bottom:3px;
   background:transparent;
   color:yellow;
}

#navlist a:hover {
   color:blue;
}
</style> 
 </head> 
 <body> 
  <div id="navcontainer"> 
   <ul id="navlist"> 
    <li id="active"> <a href="#" id="current">Lorem ip</a> </li> 
    <li> <a href="#">Lorem ip</a> </li> 
    <li> <a href="#">Lorem ipsu</a> </li> 
    <li> <a href="#">Lorem ips</a> </li> 
    <li> <a href="#">Lorem ips</a> </li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials