100%
, keeping the other as auto to maintain aspect ratio.object-fit: cover
to ensure proper cropping without distortion.To ensure an image stays within its DIV without distorting its aspect ratio in Webflow, use flexible sizing and proper object-fit settings.
100%
(if you want it to fill the width of the div) or100%
(if you want it to fill the height of the div).object-fit
for Proper Croppingcover
to expand the image while maintaining aspect ratio.contain
– Ensures the entire image is visible but may leave empty space.fill
– Stretches the image and can distort its aspect ratio.none
– Keeps the original resolution but may cause cropping issues.vh/vw
units).To prevent distortion while keeping an image inside its div, use object-fit: cover and set one dimension to 100% while keeping the other as auto. Wrapping it in a responsive div and using flexbox can further improve layout control.