make child div to be 100% height of position absolute parent container - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Absolute Position

Description

make child div to be 100% height of position absolute parent container

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">
.parent {<!--from w  w  w .j av a 2 s. c  o  m-->
   position:absolute;
   top:26px;
   right:0;
   bottom:26px;
   left:0;
   background:steelblue;
}

.child {
   height:100%;
   width:51%;
   background:pink;
}
</style> 
 </head> 
 <body> 
  <div class="parent"> 
   <div class="child"></div> 
  </div>  
 </body>
</html>

Related Tutorials