position div at the bottom of its container - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Position

Description

position div at the bottom of its container

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">
.parent {<!--from   ww  w  .  j  a  va 2 s  .c  om-->
   height:301px;
   border:6px solid Chartreuse;
   display:flex;
}

.child {
   height:41px;
   width:100%;
   background:yellow;
   align-self:flex-end;
}
</style> 
 </head> 
 <body> 
  <div class="parent"> 
   <div class="child">
     Lorem ipsum dolor sit 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials