Is there a way to proportionally scale images using CSS?
I'm looking for a solution where the image adjusts to the full container size, becoming larger or smaller based on the container dimensions. Additionally, I want the image to be displayed in the center of the container.
Edit: I've already attempted using min-width: 100%;
and max-width: 100%;
, but it only scales in one direction. With
min-width: 100%; max-height: auto;
, I fixed the main issue, but sometimes the image displays too large, requiring scrolling from the user. My goal is to have it fully displayed, increasing margins when necessary.
Appreciate any assistance!