Align floating elements of different height - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Float

Description

Align floating elements of different 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">
.photo_box {<!--from  w w  w.j  a va 2s  . co  m-->
   background:Chartreuse;
   -webkit-border-radius:6px;
   -moz-border-radius:6px;
   border-radius:6px;
   display:inline-block;
   position:relative;
   margin-bottom:16px;
   border:2px solid yellow;
   display:inline-block;
   vertical-align:top;
}

.photo_container {
   width:100px;
   height:100px;
   background:red;
}

.photo_stats_title {
   width:100px;
}
</style> 
 </head> 
 <body> 
  <div class="photo_box"> 
   <div class="photo_container"></div> 
   <div class="photo_status"> 
    <div class="photo_stats_title">
      test test test test test test test 
    </div> 
   </div> 
  </div> 
  <div class="photo_box"> 
   <div class="photo_container"></div> 
   <div class="photo_status"> 
    <div class="photo_stats_title">
      Good short title 
    </div> 
   </div> 
  </div> 
  <div class="photo_box"> 
   <div class="photo_container"></div> 
   <div class="photo_status"> 
    <div class="photo_stats_title">
      Good short title 
    </div> 
   </div> 
  </div> 
  <div class="photo_box"> 
   <div class="photo_container"></div> 
   <div class="photo_status"> 
    <div class="photo_stats_title">
      Good short title 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials