I am developing an information board for a university club of mine. I almost have it complete, except I have one annoying bug left: The center image expands beneath the viewport.
The image is supposed to shrink and expand to stay between the two side columns, which it does because of
a percentage width
css attribute. However, I would like it to not expand further once the bottom of the image makes contact with the bottom of the viewport; it should simply remain centered.
For the life of me I cannot get a solution that both stops it from growing beyond the bottom of the page without mangling the aspect ratio of the image.
I thought I was on to something with object-fit: contain
but alas, it appears width will always prioritize itself over object-fit
.
Any help would be much appreciated, as I'm quite new to web dev.
Here is a link to a client-side view of what I have so far: https://jsfiddle.net/ydumcrnk/