Two column with fixed right column layout - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Layout

Description

Two column with fixed right column layout

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, html {
   padding:0;
   margin:0;
}

.container {<!--  www  . ja  v  a2 s .  co m-->
   width:26%;
   height:100%;
   float:left;
   position:absolute;
}

.container header {
   display:block;
   height:11%;
   width:100%;
   background-color:Chartreuse;
}

.container .body {
   position:relative;
   overflow:auto;
   width:100%;
   height:81%;
   background-color:yellow;
}

.container footer {
   position:fixed;
   bottom:0;
   left:0;
   height:11%;
   width:26%;
   background-color:blue;
}

.focus {
   background-color:pink;
   position:fixed;
   left:26%;
   width:76%;
   height:100%;
   overflow:auto;
}

.focus iframe {
   width:100%;
   height:100%;
}
</style> 
 </head> 
 <body> 
  <div class="wrapper"> 
   <div class="container"> 
    <header>
      Lorem ipsum dolo 
    </header> 
    <div class="body">
      Lorem ipsum dol 
     <br> 
     <br> 
     <br> 
     <br> 
     <br> 
     <br> 
     <br> 
     <br> 
     <br> 
     <br> 
     <br> 
     <br>Lorem ipsum dolo 
     <br> 
     <br> 
     <br> 
     <br> 
     <br> 
     <br> 
     <br> 
     <br> 
     <br> 
     <br> 
     <br> 
     <br>Lorem ipsum dolo 
     <br> 
     <br> 
     <br> 
     <br> 
     <br> 
     <br> 
     <br> 
     <br> 
     <br> 
     <br> 
     <br> 
     <br>Lorem ipsum dolo 
    </div> 
    <footer>
      Lorem ipsum dolo 
    </footer> 
   </div> 
   <div class="focus"> 
    <iframe src="http://jsfiddle.net/"></iframe> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials