Making an image take the height of the div it is inside of
Problem
I want the image on the right (yellow outline) to start shrinking down if the red outline div height shrinks.
Currently the yellow outline image height is taking priority, but I want the red outline div to take priority so the image inside it shrinks.
Example videos provided of the issue happening when the image is present and also how the element behaves when the image is not present.
I would want the element to behave just how it does when the image is not present, but to have the image still there hugging the right corner, taking up just the space that it requires.
##What I've tried I've tried using various
display:flex
display:flex
and
display:inline-block
display:inline-block
variations along with
width:100%
width:100%
, but I haven't ran into a combination that would work right.