Set width on header bar - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Header

Description

Set width on header bar

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">

.header-container {<!--   w  ww  .  j  ava 2  s.com-->
   background-color: red;
   height: 40px;
   width: 960px;
}
.header {
   height: 100%;
   line-height: 40px;
   margin: 0 auto;
   width: 960px;
}
.header img {
   vertical-align: middle;
}
.main-navigation {
   float: right;
   list-style: none;
   margin: 0;
   padding: 0;
   position: relative;
}
.main-navigation li {
   float: left;
}
.main-navigation a {
   color: red;
   font-weight: bold;
   text-decoration: none;
}


      </style> 
 </head> 
 <body> 
  <div class="header-container"> 
   <div class="header"> 
    <ul class="main-navigation"> 
     <li> <a href="#">A</a> </li> 
     <li> <a href="#">B</a> </li> 
     <li> <a href="#">C</a> </li> 
     <li> <a href="#">D</a> </li> 
     <li> <a href="#">E</a> </li> 
    </ul> 
    <div class="clear"></div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials