Is it feasible to position an element absolutely at the bottom within its relative parent while maintaining the flow of its text content from top to bottom?
This is a sample layout I am referring to ---
<div class="relative" style="padding-bottom: 2em;">
<div style="position: absolute; bottom: 0;">Bottom! Can I have regular text flow, please?</div>
<div style="height: 10em;"></div>
</div>
--- and here is the Fiddle link: https://jsfiddle.net/x507Ljyh/
I am also open to any innovative solutions, such as pseudo-elements, etc. Just kindly refrain from altering the order of elements in the markup.
Thank you!
Edit
I understand that elements with absolute
positioning "do not occupy space," which is fine - the gray article
element has ample padding-bottom
due to this characteristic.
All I require is for the text in the h1
element to flow normally from top to bottom as in a regular element. Therefore, a lengthy title like "The Idler Wheel Is Wiser Than the Driver of the Screw and Whipping Cords Will Serve You More Than Ropes Will Ever Do" should conclude at the bottom of the gray article
element (and occasionally overflow to the bottom).
A similar issue concerning floats can be found here: HTML float right element order
Does this explanation make sense?
Edit 2
Many thanks to @RoToRa for resolving my concern using Flexbox. Nevertheless, I am still curious if it is possible to reverse the text content flow of absolute
elements to normal somehow, so I will keep this question active.