Centering items in header menu - CSS - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu Item

Description

Centering items in header menu - CSS

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">
html, body {
   height:100%;
   width:100%;
}

#menu {<!--  w  w  w  .  j a  v  a2s  . c o m-->
   position:fixed;
   top:0;
   left:0;
   width:100%;
   z-index:100;
   background:Chartreuse;
}

#cab_menu {
   width:100%;
   position:relative;
}

#cab_menu a {
   font-size:13px;
   font-weight:bold;
   padding:21px 11px;
   display:inline-block;
   color:yellow;
}

.clearfix {
   display:block;
}

.conteudo_menu {
   width:100%;
   margin:0 auto;
   text-align:center;
}
</style> 
 </head> 
 <body> 
  <div class="inicio_m"></div> 
  <div id="menu"> 
   <div id="cab_menu" class="clearfix"> 
    <div class="conteudo_menu clearfix"> 
     <a href="#1">Lorem </a> 
     <a href="#2">Lorem </a> 
     <a href="#3">Lorem </a> 
     <a href="#4">Lorem </a> 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials