CSS layout for vertical stacked divs to use 100% of available height - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Layout

Description

CSS layout for vertical stacked divs to use 100% of available height

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">
#wrapper<!-- w  ww .  j av  a 2s  .  com-->
 {
   border:2px solid Chartreuse;
   padding:11px;
   height:401px;
}

#container
 {
   background-color:yellow;
   height:100%;
}

#div-1,
#div-2
 {
   padding:6px;
}

#div-1
 {
   border-bottom:11px solid blue;
}
</style> 
 </head> 
 <body> 
  <div id="wrapper"> 
   <div id="container"> 
    <div id="div-1">
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulum tortor neque, ornare vitae tempor hendrerit, luctus at neque. Phasellus sed quam pharetra, tincidunt tortor in, pharetra nisl. Maecenas aliquam luctus mauris, vitae venenatis diam imperdiet vel. Donec tortor diam, pretium vitae nibh vitae, consectetur lacinia sem. Proin luctus f 
    </div> 
    <div id="div-2">
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulum tortor neque, ornare vitae tempor hendrerit, luctu 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials