Make image same height as text, using CSS?
I have a flex-container with an image in one section, and text in the other. Is it possible to make these the same height? I don't want to use background-image instead, for accessibility purposes. And Javascript doesn't seem suitable since it would affect the loading speed
https://codepen.io/markus-b/pen/dyKwwER
4 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
maybe something like this?
now both sections have same width (flex: 1) and same height (nature of flex) and the image is placed relative to it's container with object-fit
I was a bit unclear @pesahson 🙂 the image would be sized according to the text. @MarkBoots solution should work great, thanks!