I have tried lots of tricks to force the responsive images to fit to the flex container when the direction is set to flex-direction: column;
but none of them works. I have to mention that it works well with other elements such as text or when flex direction is set to flex-direction: row;
but not in my case. I have tried flex:1;
,flex-shrink
,flex-grow
,max-height
properties to achieve what I want but all failed.
How to create a flex container with one column and three rows when the size of the container is fixed (width:234px; height:279px
) and the height of each row is flexible in order to show 3 images at their maximum size? If they couldn't fit into their container then shrink them but keep the aspect ratio.