Display: table-cell with child height: 100% - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Cell

Description

Display: table-cell with child height: 100%

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <title>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mor</title> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
html, body {
   height:100%;
}

.tab {<!--from www .j a v a  2 s .c  o  m-->
   display:table;
   height:100%;
   width:201px;
}

.row {
   height:100%;
   display:table-row;
}

.elem {
   border:2px solid Chartreuse;
   vertical-align:top;
   display:table-cell;
   height:100%;
   background:blue;
}

.content {
   height:100%;
   background:greenyellow;
}
</style> 
 </head> 
 <body> 
  <div class="tab"> 
   <div class="row"> 
    <div class="elem"> 
     <div class="content">
       Lorem ips 
     </div> 
    </div> 
    <div class="elem"> 
     <div class="content">
       Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulu 
     </div> 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials