The object-position property sets how the content of a replaced element — usually an <img> or <video> — is aligned inside the element’s box.
It pairs with object-fit. Fit chooses how the media scales; position chooses which part stays in view after cropping or letterboxing. Empty areas show the element’s background. The initial value is 50% 50% (center). It is not inherited.
Baseline · Widely available.
Not deprecated and not experimental. Keyword, length, and percentage values are safe in current browsers. Logical keywords such as x-start are newer and still missing in some browsers.
Syntax
CSS Syntax
syntax.css
object-position:<position> | initial | inherit;
A position is one to four values: keywords (top, left, center), percentages, lengths, or an edge offset such as bottom 10px right 20px.
First length is horizontal.20px shifts from the left edge of the box.
Second length is vertical.10px shifts from the top edge.
Same grammar as background-position. Edge offsets such as bottom 10px right 20px also work.
Values can go outside the box. The object may be drawn partly outside; leftover space shows the background.
Edge Cases & Pitfalls
If the crop focus does not move, one of these is usually why.
fit
No crop, little to see
With the default object-fit: fill, or when the image already matches the box, position changes are hard to notice. Use object-fit: cover (or none) when teaching or debugging position.
size
Needs a sized box
Without width and height that differ from the media’s natural size, there is no frame to align inside. Size the element first.
order
Fit first, then position
object-fit decides how much is cropped. object-position only chooses which part of that result stays visible. They do not replace each other.
A bad crop can cut off faces or text. Keep meaningful alt text, and adjust position (or the frame ratio) when the subject matters.
Compatibility
Browser Support
object-position is a browser CSS property for replaced elements. Node.js, Deno, and Bun do not apply it.
✓ Baseline · Widely available since 2020
object-position
Chrome 31+, Firefox 36+, Safari 10+, Edge 16+, Opera 19+. Internet Explorer has no native support.
97%Modern browser support
Google Chrome31+ · Desktop & Mobile
Full support
Mozilla Firefox36+ · Desktop & Mobile
Full support
Apple Safari10+ · macOS & iOS
Full support
Microsoft Edge16+ · Chromium & Legacy
Full support
Opera19+ · Modern versions
Full support
Samsung Internet3+ · Android
Full support
Internet ExplorerNo support
None
object-positionWidely supported
Bottom line: Safe for modern responsive layouts. Logical position keywords such as x-start are newer — stick to classic keywords, percentages, and lengths for widest support. Pair with object-fit: cover for card and avatar crops.
Remember
Key Takeaways
Role: choose which part of replaced media stays visible inside its box.
Default:50% 50% (center). Not inherited.
Pair with cover:object-fit crops; object-position steers the crop.
Values: keywords, percentages, lengths, or edge offsets — same idea as background-position.
One line: after object-fit scales the media, object-position picks the focus inside the frame.
Frequently Asked Questions
It sets where replaced content such as an image or video sits inside its box. It is most useful when object-fit: cover crops the media and you need to keep a face or logo in view.
50% 50%, which centers the content horizontally and vertically. Writing center is the common keyword form of that default.
object-fit decides how the content is scaled (cover, contain, fill). object-position decides which part of that scaled content stays visible inside the box.
If the content already matches the box with no crop or letterbox, moving it has nothing to reveal. Pair it with object-fit: cover or none when the media is larger than the box.
Yes. Values can shift the object so part of it is drawn outside the element's box. Empty areas show the element's background.
It is Baseline and widely available: Chrome 31+, Firefox 36+, Safari 10+, Edge 16+, and Opera 19+. Internet Explorer has no support. It is a browser CSS property, not a Node.js feature.