object-position
Widely availableSince 202097% of users
Sets the alignment of an image or video within its container when using object-fit. It's like background-position but for replaced elements like <img> and <video>.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyModernIn every major browser since January 2020. Widely available since July 2022.
See how modern your own CSS is.Check your CSS →
Quick facts
- Initial value
50% 50%- Inherited
- Yes
- Applies to
- replaced elements
- Animation type
- repeatableList
Quick example
img.profile-shot {
width: 100%;
height: 200px;
object-fit: cover;
object-position: center 20%;
/* focuses the crop on the subject's face (top portion of the image) */
}object-position browser support
BaselineWidely availableThis feature is well established and works across many devices and browser versions. It has been available across browsers since 2020.Safe to use without fallbacks.
Usage97%of people can use this3% use a browser without it.
Browsers
32+
36+
10+
79+Mobile
32+Android
36+Android
10+iOS