The object-position property controls which part of an image or video stays visible inside its container. It is especially helpful when content is cropped by object-fit: cover and you need to keep the subject in frame.
01
Content Alignment
Anchor media inside a box.
02
Syntax
Keywords, %, and lengths.
03
Keywords
top, center, bottom, left, right.
04
Percentages
Fine-tune visible area.
05
Default Center
Starts at 50% 50%.
06
With object-fit
Control crop focus.
Fundamentals
Introduction
The object-position property in CSS is used to specify the alignment of the content within a replaced element, such as an image or a video.
This property is particularly useful when the content is larger than the element’s box and gets cropped. By adjusting the position, you can control which part of the content is visible within the element.
Definition and Usage
The object-position CSS property sets the anchor point of replaced content inside its box. Think of it like choosing which corner or center of a photo should stay visible when the frame is smaller than the image.
It works best alongside sizing properties and often pairs with object-fit when you want responsive thumbnails, avatars, or hero banners that crop cleanly without losing the important subject.
💡
Beginner Tip
If a face or logo gets cut off inside a cropped image, try object-position: top center or object-position: center left before changing the container size.
Foundation
📝 Syntax
The syntax for the object-position property is straightforward. It allows you to specify the position of the content within the element using keywords, percentages, or length units:
The circular frame crops the image, and center top keeps the upper area of the photo in view for headshots.
Companion
Pair with object-fit
object-position works best when the browser has already decided how content should fit. Use object-fit: cover or contain first, then adjust position to control what remains visible.
Do not crop out meaning — If repositioning hides important content, choose a different crop or image.
Keep alt text accurate — Describe the image itself, not just the visible cropped portion.
Test on small screens — A position that works on desktop may crop differently on mobile.
Avoid text inside images — Cropping can remove words users need to read.
🧠 How object-position Works
1
Content is sized to the box
Width, height, and often object-fit determine how the media fills the container.
Layout
2
You choose an anchor point
Keywords, percentages, or lengths set where the content should align inside the box.
object-position
3
Overflow is reframed
When content is larger than the box, a different position reveals another part of the image or video.
Rendering
=
📍
Better cropped media
The important subject stays visible even when the frame does not match the original image ratio.
Compatibility
Browser Compatibility
The object-position property is widely supported in modern browsers, including Chrome, Firefox, Safari, Edge, and Opera. Verify compatibility and test across browsers to ensure consistent rendering.
✓ Baseline · Modern browsers
Reliable support for media alignment
Chrome, Edge, Firefox, Safari, and Opera all support object-position in current versions.
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
Fallback behavior
When unsupported, content stays centered similar to the default 50% 50% behavior.
💻
Internet ExplorerNo support · Consider background-image positioning as a fallback
None
object-position property97% supported
Bottom line: Use object-position confidently with object-fit in modern responsive layouts.
Wrap Up
Conclusion
The object-position property is a useful tool for controlling the alignment of content within replaced elements. It allows you to ensure that the most important part of the content is visible, even when the element’s size does not match the content’s dimensions.
Experimenting with different values can help you achieve the desired visual effect on your website, especially when combined with object-fit for responsive images and videos.
Pair with object-fit: cover for cropped thumbnails
Use top center for portraits and headshots
Try percentages when keyword alignment is not exact enough
Test crops on mobile and desktop breakpoints
Keep important subjects away from frame edges when possible
❌ Don’t
Expect visible changes without overflow or cropping
Confuse object-position with background-position
Hide critical product details with aggressive cropping
Forget that the default is already centered
Rely on position alone without sizing the media box
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about object-position
Use these points when reframing cropped media.
5
Core concepts
📍01
Anchor Point
Chooses visible area.
Purpose
📝02
Keywords
top, center, right, etc.
Values
📐03
50% 50% Default
Centers content.
Default
🖼️04
With object-fit
Best for cropped media.
Companion
🎯05
Fine Control
Percentages and lengths.
Precision
❓ Frequently Asked Questions
object-position controls which part of replaced content such as an image or video is visible inside its box, especially when the content is cropped or does not fill the container.
The default is 50% 50%, which centers the content horizontally and vertically within the element.
object-fit decides how content is scaled to fit the box. object-position decides where the content is anchored inside that box after scaling.
Yes. You can combine horizontal and vertical keywords such as top right, bottom center, or left center.
It is most useful with object-fit: cover when you need to keep faces, products, or logos in view after cropping.