Layout to have second div occupy the rest width - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Layout

Description

Layout to have second div occupy the rest width

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">
.a {<!--   w ww  .  j  ava  2  s.  c  o m-->
   position:absolute;
   width:201px;
   background-color:Chartreuse;
   height:100%;
}

.b {
   width:100%;
   position:absolute;
   left:201px;
   background-color:yellow;
   height:100%;
}

.cont {
   position:relative;
   border:2px solid blue;
   min-height:301px;
   overflow:hidden;
}
</style> 
 </head> 
 <body> 
  <div class="cont"> 
   <div class="a"></div> 
   <div class="b"></div> 
  </div>  
 </body>
</html>

Related Tutorials