Child elements of a display:box parent maintain their defined height - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Box

Description

Child elements of a display:box parent maintain their defined 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">
.container {<!-- ww  w.  j  av a 2 s  . c o  m-->
   display:-moz-box;
   display:-webkit-box;
   display:box;
   -webkit-box-orient:horizontal;
}

.box
 {
   display:-moz-box;
   display:-webkit-box;
   display:box;
   -webkit-box-orient:vertical;
}

.ord1, .ord2, .ord3 {
   border:2px solid Chartreuse;
   margin:11px;
   padding:6px;
   min-height:100px;
}

.ord1
 {
   -moz-box-ordinal-group:2;
   -webkit-box-ordinal-group:2;
   box-ordinal-group:2;
}

.ord2
 {
   -moz-box-ordinal-group:3;
   -webkit-box-ordinal-group:3;
   box-ordinal-group:3;
}

.ord3
 {
   -moz-box-ordinal-group:4;
   -webkit-box-ordinal-group:4;
   box-ordinal-group:4;
}

.withHeight {
   height:301px;
}
</style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="box"> 
    <div class="ord3">
      Lorem ipsum dolor sit amet, consect 
    </div> 
    <div class="ord2">
      Lorem ipsum dolor sit amet, consectetu 
    </div> 
    <div class="ord1">
      Lorem ipsum dolor sit amet, consect 
    </div> 
   </div> 
   <br> 
   <br> 
   <div class="box"> 
    <div class="ord3 withHeight">
      Lorem ipsum dolor sit amet, consect 
    </div> 
    <div class="ord2">
      Lorem ipsum dolor sit amet, consectetu 
    </div> 
    <div class="ord1">
      Lorem ipsum dolor sit amet, consect 
    </div> 
   </div> 
   <br> 
   <br> 
   <div class="box"> 
    <div class="ord3 withHeight">
      Lorem ipsum dolor sit amet, consect 
    </div> 
    <div class="ord2">
      Lorem ipsum dolor sit amet, consectetu 
    </div> 
    <div class="ord1">
      Lorem ipsum dolor sit amet, consect 
    </div> 
   </div> 
  </div> 
  <p> <b>Lorem</b>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ul</p>  
 </body>
</html>

Related Tutorials