Positioning to make certain element occupy rest of the space in a parent div - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Position

Description

Positioning to make certain element occupy rest of the space in a parent div

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">
div {<!--from  ww  w  . j av a2  s .c  o  m-->
   height:21px;
}

div>div {
   float:left;
}

#fixed {
   background:Chartreuse;
   width:21px;
}

#fluid {
   background:yellow;
   width:-webkit-calc(100% - 41px);
   width:-moz-calc(100% - 41px);
   width:calc(100% - 41px);
}
</style> 
 </head> 
 <body> 
  <div> 
   <div id="fixed"></div> 
   <div id="fixed"></div> 
   <div id="fluid"></div> 
  </div>  
 </body>
</html>

Related Tutorials