CSS: position:fixed and horizontal scrolling - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Fixed Position

Description

CSS: position:fixed and horizontal scrolling

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 {<!--from ww w.j  a  v a 2s  .c  o  m-->
   margin:0;
   padding:0px
}

.container {
   width:1201px;
   margin:0 auto;
   padding-bottom:51px
}

.greenbg {
   background-color:Chartreuse;
   width:341px;
   height:897px;
   position:absolute;
   margin-left:21px;
   top:0px;
   bottom:0px
}

.greybg {
   background-color:yellow;
   width:341px;
   height:396px;
   position:absolute;
   margin-left:21px;
   top:0px
}

.containershadow {
   box-shadow:0px 0px 16px blue;
   margin-top:61px
}

.whitebgtop {
   background-color:pink;
   width:1201px;
   height:261px
}

.menu {
   background-color:OrangeRed;
   width:1201px;
   height:27px
}

.textarea {
   background-color:grey;
   width:1201px;
   min-height:501px
}
</style> 
 </head> 
 <body style="margin: 0; padding: 0px"> 
  <div class="container"> 
   <div class="greenbg"></div> 
   <div class="greybg"></div> 
   <div class="containershadow"> 
    <div class="whitebgtop"></div> 
    <div class="menu"></div> 
    <div class="textarea"></div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials