This is driving me crazy and I don't think it is even possible at this point, but I would like to consult the Internet Gods before I give up.
Visual representation of what I want:
I want the text to align at the top-left of the container, and the image to align itself in the center of the space that is leftover after (if) the text wraps.
Please see demo
I'm using flexbox
and margin: 0 auto
to get the centering I want, and position: absolute
on the h2
element works fine if the image is long, but looks terrible with tall image.
Is there some flexbox magic I can use to take into account the height of the dynamically loaded h2 element and make the image centered within the rest of the free space?
Constraints:
- The parent container must be 200px by 200px.
- Image can not be distorted (stretched).