Align an element to the bottom within a flexbox, without using position:absolute - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Flex Align

Description

Align an element to the bottom within a flexbox, without using position:absolute

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">
* {<!-- w  ww . j ava  2 s  . com-->
   margin:0;
   padding:0;
}

ul {
   display:-webkit-flex;
   display:flex;
   -webkit-flex-flow:row wrap;
   flex-flow:row wrap;
   flex-direction:row;
   flex-wrap:wrap;
   -webkit-align-content:flex-end;
   align-content:flex-end;
}

.tile {
   width:34%;
   display:flex;
   box-sizing:border-box;
   justify-content:space-between;
   flex-direction:column;
}

.content {
   background:beige;
}

.footer {
   background:teal;
}
</style> 
 </head> 
 <body> 
  <ul> 
   <li class="tile"> 
    <div class="content"> 
     <div class="photo"></div> 
     <h3>This is some long long long long long long long long long long long long long long long long content</h3> 
    </div> 
    <div class="footer"> 
     <input type="submit"> 
    </div> </li> 
   <li class="tile"> 
    <div class="content"> 
     <div class="photo"></div> 
     <h3>This is some content</h3> 
    </div> 
    <div class="footer"> 
     <input type="submit"> 
    </div> </li> 
   <li class="tile"> 
    <div class="content"> 
     <div class="photo"></div> 
     <h3>This is some content</h3> 
    </div> 
    <div class="footer"> 
     <input type="submit"> 
    </div> </li> 
  </ul>  
 </body>
</html>

Related Tutorials