Header and navigation aligned - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Header

Description

Header and navigation aligned

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

body {<!--  w  w w.  j  a v a 2 s  .  c  om-->
   margin: 0;
}
header {
   background: gray;
   color: white;
}
header h1 {
   margin: 0;
   display: inline-block;
   height:40px;
}
nav {
   margin: 0;
   display: inline-block;
   height:40px;
}
nav ul li {
   list-style-type: none;
   display: inline-block;
   background: black;
   color: white;
   padding: 5px 15px;
}
nav ul li a {
   color: white;
}
      </style> 
 </head> 
 <body> 
  <header> 
   <h1>My page</h1> 
   <nav> 
    <ul> 
     <li> <a href="*">Home</a> </li> 
     <li> <a href="*">Blog</a> </li> 
     <li> <a href="*">About</a> </li> 
     <li> <a href="*">Contact</a> </li> 
     <li> <a href="*">Links</a> </li> 
    </ul> 
   </nav> 
  </header> 
  <div class="row"> 
   <div class="col">
     col1 
   </div> 
   <div class="col">
     col2 
   </div> 
   <div class="col">
     col3 
   </div> 
  </div> 
  <footer>
    2015 My site 
  </footer>  
 </body>
</html>

Related Tutorials