Extend a CSS column to the top of its parent - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Column Layout

Description

Extend a CSS column to the top of its parent

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">

.display-table {
   display: table;
}
.display-tCell{
   display: table-cell;
   vertical-align: top;
   background-color: gray;
}
.col2{<!--  w ww.ja  va 2s  .c om-->
   background-color: red;
}


      </style> 
 </head> 
 <body> 
  <div class="display-table"> 
   <div class="display-tCell">
     test
    <br> texttexttest
    <br> test
    <br> texttexttest
    <br> test
    <br> texttexttest
    <br> test
    <br> texttexttest
    <br> test
    <br> texttexttest
    <br> test
    <br> texttexttest
    <br> 
   </div> 
   <div class="display-tCell col2">
     test
    <br> texttexttests
   </div> 
  </div>  
 </body>
</html>

Related Tutorials