Recently, I came across the following code:
.home_post_cont { width: 228px; min-height: 331px; }
.home_post_cont img { width: 228px; height: 331px; }
This code allows the image to fit perfectly within its container.
However, I am now looking for a different solution:
.home_post_cont img { width: 100%; height: 100%; } /* To adapt to changes in container size */
The challenge is that I can only set either the width or the height to 100%. I do not want the image to scale, but instead maintain a fixed 100% width and height relative to the container.
Does anyone have suggestions on how I can achieve this?