
CSS object-fit Property - W3Schools
The CSS object-fit property is used to specify how an <img> or <video> should be resized to fit its container. This property can take one of the following values:
object-fit - CSS | MDN
Nov 7, 2025 · The object-fit CSS property sets how the content of a replaced element, such as an <img> or <video>, should be resized to fit its container.
object-fit - CSS-Tricks
Feb 2, 2015 · The object-fit property defines how an element responds to the height and width of its content box. It’s intended for images, videos and other embeddable media formats in conjunction …
CSS object-fit Property - GeeksforGeeks
Jun 18, 2024 · The CSS object-fit property is used to control how an image or video is resized to fit its content box. This property offers various methods to fill the content box, such as preserving the …
CSS object-fit Property - CSS Portal
Jan 1, 2026 · Learn about the object-fit CSS Property. View description, syntax, values, examples and browser support for the object-fit CSS Property.
CSS object-fit Property - W3docs
The object-fit property is used to specify how an element should be resized to fit its content box. The object-fit property allows to fit the contents of an image into the dimensions specified in the style sheet.
How To Scale and Crop Images with CSS object-fit - DigitalOcean
Jan 6, 2026 · Learn how to use CSS object-fit to scale, crop, and position images responsively without distorting aspect ratios, plus a comparison with background-size.
CSS Object-Fit Property: Complete Guide to Image and Video Sizing ...
Jun 19, 2025 · The CSS object-fit property is a powerful tool that controls how replaced elements like images and videos are resized to fit their containers. Instead of stretching or distorting media …
How to Use CSS object-fit and object-position - SitePoint
Jul 20, 2023 · Learn how to use CSS object-fit to determine how images fit within a given space, and how to position those images with object-position.
A Quick Overview of `object-fit` and `object-position` - CSS-Tricks
Feb 19, 2016 · To preserve the image’s aspect ratio whilst also filling in the space, we can use object-fit: The image on the left is our original and the image on the right has cut off the sides of the image, …