div at bottom of parent div
See original GitHub issueI’m trying to get a div “float” to the bottom of the containing div.- e.g http://stackoverflow.com/questions/2147303/how-can-i-send-an-inner-div-to-the-bottom-of-its-parent-div The containing div is the element which is “matchHeighted”.
The pseudo-HTML contains:
<div class="content">
<div class="frontpage-item">
<div class="floatdown">
<div class="frontpage-item">
<div class="frontpage-item">
</div>
CSS
.frontpage-item {
position: relative;
}
.frontpage-item .floatdown {
bottom: 0;
position: absolute;
}
js contains
$(document).ready(function() {
$(".frontpage-item").matchHeight(false);
The problem is that as soon as I “apply” position:absolute to the inner-div,- whether by css as above or later on via js/jquery (this is the actual idea), the height of the .frontpage-item div “collapses” to the height on it’s content without the inner div.
Clearly position:absolute breaks the flow - but I figured since matchHeight sets the height of the containing div explicitly this would have no effect. Somehow the flow-break bubbles up to this element afterall.
Is there any way to stop this or is there any other technique you know of to have the text of the inner-div aligned to the bottom of the outer div - without causing such a collapse? (been struggling with this for a couple of hours!)
Issue Analytics
- State:
- Created 9 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Check out my solution, LAZADA inspired.
HTML:
CSS:
I am trying to do the same, but your trick doesn’t work for me. Any other ideas?