Css percentage width and height on header - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Header

Description

Css percentage width and height on header

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 {<!--  w  w  w.  j  a v a  2 s .co m-->
   width: 100%;
   height: 5%;
   background-color: Aqua;
}
.basic, .nav {
   height: 100%;
}
.basic {
   width: 15%;
   background-color: red;
   float:left;
}
.nav {
   background-color: green;
   margin-left:15%;
}
.basic span, .nav span {
   display: inline-block;
   margin: 0;
   padding: 0;
}


      </style> 
 </head> 
 <body> 
  <div class="header"> 
   <div class="basic"> 
    <span>Logo</span> 
    <span>Home</span> 
    <span>Login</span> 
   </div> 
   <div class="nav"> 
    <span>First</span> 
    <span>Second</span> 
    <span>Third</span> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials