Position fixed to top - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Fixed Position

Description

Position fixed to top

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  a2s .  c  o m-->
   height:201px;
   border:2px solid Chartreuse;
   width:100%;
   position:fixed;
   left:0px;
   top:0px;
}

.content {
   height:801px;
   border:2px solid yellow;
   position:absolute;
   top:201px;
}
</style> 
 </head> 
 <body> 
  <div class="header"> 
  </div> 
  <div class="content"> 
  </div>  
 </body>
</html>

Related Tutorials