Create layout with fixed width content and flexible stretchable sidebar - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Flex

Description

Create layout with fixed width content and flexible stretchable sidebar

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">
#container {<!--from ww w .java2  s .c om-->
   position:relative;
   min-width:311px;
}

#container .left {
   background-color:Chartreuse;
   margin-right:211px;
   height:201px;
}

#container .content {
   float:right;
   background-color:yellow;
   width:201px;
   height:201px;
   position:absolute;
   top:0;
   right:0;
}
</style> 
 </head> 
 <body> 
  <div id="container"> 
   <div class="left">
     a 
   </div> 
   <div class="content">
     b 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials