Centering a nav menu - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Nav Bar

Description

Centering a nav menu

Demo Code

ResultView the demo in separate window

<html lang="en">
 <head> 
  <title>Lorem ips</title> 
  <style>
#menu {<!--from  w ww .  j  a v  a  2 s  . c om-->
   background:Chartreuse;
   border-top:3px solid yellow;
   border-bottom:3px solid blue;
   color:pink;
   height:51px;
   z-index:10;
   width:1081px;
   margin:0 auto;
}

#menu ul,
#menu li {
   margin:0 auto;
   padding:0 0;
   list-style:none
}

#menu ul {
   height:81px;
   width:1081px;
   text-align:center;
}

#menu li {
   display:inline-block;
   position:relative;
   font:bold 13px "Arial", sans-serif;
   text-transform:none;
}

#menu a {
   display:block;
   line-height:51px;
   padding:0 31px;
   text-decoration:none;
   color:OrangeRed;
   border-right:2px solid grey;
}

li.home a {
   background:none;
}
</style> 
 </head> 
 <body translate="no"> 
  <nav id="menu"> 
   <ul> 
    <li class="#"> <a href="/">Lorem </a> </li> 
    <li> <a href="#">Lorem ipsum</a> </li> 
    <li> <a href="#">Lorem ipsum</a> </li> 
   </ul> 
  </nav>  
 </body>
</html>

Related Tutorials