--- title: Object fit description: Use the object fit utilities to modify how the content of a replaced element, such as an `` or ``, should be resized to fit its container. toc: true added: version: "5.3" --- ## How it works Change the value of the [`object-fit` property](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit) with our responsive `object-fit` utility classes. This property tells the content to fill the parent container in a variety of ways, such as preserving the aspect ratio or stretching to take up as much space as possible. Classes for the value of `object-fit` are named using the format `.object-fit-{value}`. Choose from the following values: - `contain` - `cover` - `fill` - `scale` (for scale-down) - `none` ## Examples Add the `object-fit-{value}` class to the [replaced element](https://developer.mozilla.org/en-US/docs/Web/CSS/Replaced_element): `} /> ## Responsive Responsive variations also exist for each `object-fit` value using the format `.object-fit-{breakpoint}-{value}`, for the following breakpoint abbreviations: `sm`, `md`, `lg`, `xl`, and `xxl`. Classes can be combined for various effects as you need. `} /> ## Video The `.object-fit-{value}` and responsive `.object-fit-{breakpoint}-{value}` utilities also work on `` elements. ```html ``` ## CSS ### Sass utilities API Object fit utilities are declared in our utilities API in `scss/_utilities.scss`. [Learn how to use the utilities API.]([[docsref:/utilities/api#using-the-api]])