Centering div element inside html header tag - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Header

Description

Centering div element inside html header tag

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{<!--from w w  w  . j a  v  a  2s.co m-->
   width: 100%;
   height: 51px !important;
   position: fixed;
   background-color: white;
   margin: 0 auto;
   box-shadow: 0 1px 3px rgba(0,0,0,0.25);
   -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.25);
   -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.25);
   z-index:100;
   top: 0;
   text-align: center;
}
.toolbar {
   position:fixed;
   background: #000;
   z-index: 1000;
   width: 50px;
   margin: 0 auto;
   padding: 10px 25px;
   display: inline-block;
}


      </style> 
 </head> 
 <body> 
  <header> 
   <div class="toolbar"> 
   </div> 
  </header>  
 </body>
</html>

Related Tutorials