I have a very strange problem that I tried to solve in the last 2 days to no avail. The page I am creating has the following structure:

I can easily get a shared parent AB layout with display: flex; flex-direction: column; align-items: stretch display: flex; flex-direction: column; align-items: stretch display: flex; flex-direction: column; align-items: stretch and setting A flex: 0 0 auto , and B - flex: 1 1 0; min-height: 100px; flex: 1 1 0; min-height: 100px;
However, I have a real problem with the layout of C and D inside B. I feel that flex / row is the right approach for B, but I just can't get the specifics. So I try:
.B { display: flex; flex-direction: row; align-items: stretch; justify-content: space-between; } .C { flex: 1 1 0; } .D { object-fit: scale-down; }
But this is clearly not enough. The image either does not zoom out at all, it scales, but it gets distorted or leaves a lot of space if I installed it also with flex: 1 1 0 with a minimum width.
Any ideas how I can achieve what I need here?
UPDATE: I tried putting jsfiddle here - https://jsfiddle.net/2gsrzwwq/3/ - but for some reason it wonβt even honor height:100% on the parent. Regarding the installation of the image, I need the image to be reduced to the height of D div, and then reduced to the width of the D-block, just to contain the reduced image, and for block C to occupy the remaining width.
source share