html - CSS Align top of child container to bottom of parent container -


consider html

<div class="parent">     <a href="#">parent</a>     <div class="child">         <a href="#">child</a>     </div> </div> 

what want position top of child bottom of parent.

here's css far:

.parent {     position: relative; }  .child {     position: absolute;     left: 0;     bottom: 0; } 

what achieves this:

example 1

what want achieve this:

example 2

please note: not know height of either parent or child container, , don't want set arbitrary height, , don't want revert using javascript.

.parent {     position: relative;     background-color: #f00; }  .child {     position: absolute;     top: 100%;     left: 0;     background-color: #00f; } 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -