My mind is racing with this problem and I'm not sure if it's solvable, but before throwing in the towel, I thought I'd seek help from the Internet Gods.
Here's a visual representation of what I'm aiming for:
I want the text to align at the top-left corner of the container, while the image should position itself in the center of any remaining space after text wrapping (if applicable).
For a demonstration, check out this demo.
Currently, I am utilizing 'flexbox' and 'margin: 0 auto' to achieve the desired centered layout. However, when working with a lengthy image, using 'position: absolute' on the 'h2' element results in an unfavorable appearance.
Is there a way to employ some flexbox wizardry that takes into consideration the height of the dynamically loaded 'h2' element and centers the image within the available free space?
Here are the constraints to keep in mind:
- The parent container must maintain dimensions of 200px by 200px.
- The image cannot be distorted or stretched.