I'm trying to create a particular card layout with a 250px wide image on the left and a variable amount of copy on the right. The hard part is I want the height of the element to be determined by the copy, not the image. And whatever is above/below the image I just want to be centered and cropped off. So far I haven't been able to make this layout work without setting a height to the element, which obviously wont work for all different copy.
Asked
Active
Viewed 15 times
0
-
make the image position absolute, height 100%, width 250px and parent position relative with padding-left 250px – Chris Li Jun 08 '23 at 14:50
-
A code snippet would help. Easy to achieve if the image is used as CSS background to a box with fixed width. Also achievable with little effort using flex and an `
` element – julien.giband Jun 08 '23 at 15:19