Stack multiple divs to bottom of parent div - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL

Description

Stack multiple divs to bottom of parent div

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 {<!-- www .jav a  2 s .  com-->
   height:301px;
   border:2px solid;
   padding:6px;
   display:table-cell;
   vertical-align:bottom;
}

.message {
   border:2px solid;
   margin-top:6px;
}
</style> 
 </head> 
 <body> 
  <p>Top of page</p> 
  <div id="container"> 
   <div class="message">
     Message 4 
   </div> 
   <div class="message">
     Message 3 
   </div> 
   <div class="message">
     Message 2 
   </div> 
   <div class="message">
     Message 1 
   </div> 
  </div> 
  <p>Bottom of page</p>  
 </body>
</html>

Related Tutorials