Header staying in place - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Header

Description

Header staying in place

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.  java 2s.co  m-->
{
   position:fixed;
   height:100px;
   background-color:#ccc;
   width:100%;
   top:0;
   left:0;
}
#content
{
   margin-top:105px;
   height:800px;
   background-color:#666;
}
      </style> 
 </head> 
 <body> 
  <div id="header">
    header 
  </div> 
  <div id="content">
    content 
  </div>  
 </body>
</html>

Related Tutorials