Say I have the following CSS and HTML code:
After struggling with this same issue for some time, I finally figured out a solution that meets all of my requirements:
The solution just takes one CSS html This trick works by creating a tall, skinny div, which pushes the text baseline to the bottom of the container. Here is a complete example that achieves what the OP was asking for. I've made the "bottom_aligner" thick and red for demonstration purposes only. CSS: HTML:.bottom_aligner {
display: inline-block;
height: 100%;
vertical-align: bottom;
width: 0px;
}
... Your content here ...
.outer-container {
border: 2px solid black;
height: 175px;
width: 300px;
}
.top-section {
background: lightgreen;
height: 50%;
}
.bottom-section {
background: lightblue;
height: 50%;
margin: 8px;
}
.bottom-aligner {
display: inline-block;
height: 100%;
vertical-align: bottom;
width: 3px;
background: red;
}
.bottom-content {
display: inline-block;
}
.top-content {
padding: 8px;
}
is on top.
at the bottom.