Position: fixed to have same with browser - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Fixed Position

Description

Position: fixed to have same with browser

Demo Code

ResultView the demo in separate window

<html lang="en">
 <head> 
  <style>
body {<!--   w ww.  j a  va2 s  .c om-->
   margin:0;
}

header {
   width:91%;
   height:100px;
   background:blue;
   position:fixed;
   z-index:100;
}

.container {
   width:91%;
   height:501px;
   background:red;
   position:relative;
   z-index:-3;
}
</style> 
 </head> 
 <body translate="no"> 
  <header>
    Lorem ipsum dolor 
  </header> 
  <div class="container">
    Lorem ipsum dolor sit 
  </div>  
 </body>
</html>

Related Tutorials