Fluid width fixed position - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Fixed Position

Description

Fluid width fixed position

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">
.outer {<!--from w  w  w. jav a2s  .c  o  m-->
   width:21%;
   height:1201px;
   margin-left:6%;
   float:left;
}

.outer1 {
   background:yellow;
}

.outer2 {
   background:red;
}

.outer3 {
   background:gray;
}

.inner {
   height:201px;
   position:fixed;
   top:0;
}

.inner1 {
   background:orange;
   right:76%;
   left:6%;
}

.inner2 {
   background:pink;
   right:51%;
   left:31%;
}

.inner3 {
   background:black;
   right:26%;
   left:56%;
}
</style> 
 </head> 
 <body> 
  <div class="outer outer1"> 
   <div class="inner inner1"> 
   </div> 
  </div> 
  <div class="outer outer2"> 
   <br> 
   <br> 
   <br> 
   <br> 
   <br> 
   <br> 
   <br> 
   <br> 
   <br> 
   <br> 
   <br> 
   <br> 
   <br>Lorem i 
   <br> 
   <br> 
   <br> 
   <br> 
   <br> 
   <br> 
   <br> 
   <br> 
   <br> 
   <br>Lorem i 
   <br> 
   <br> 
   <br> 
   <br> 
   <br> 
   <br> 
   <br> 
   <br> 
   <br> 
   <br> 
   <br> 
   <br> 
   <br>Lorem i 
   <br> 
   <br> 
   <br> 
   <br> 
   <br> 
   <br> 
   <br> 
   <br> 
   <br> 
   <br>Lorem i 
   <div class="inner inner2">
     Lorem i 
    <br> 
    <br> 
    <br> 
    <br> 
    <br> 
    <br> 
    <br> 
    <br>Lorem i 
   </div> 
  </div> 
  <div class="outer outer3"> 
   <div class="inner inner3"> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials