The background-position property sets where a background image starts inside an element. You can use keywords, percentages, or pixel values to place backgrounds exactly where you want them.
01
Placement
Move background images.
02
Keywords
top, left, center.
03
Percentages
Relative positioning.
04
Pixels
Exact distances.
05
Two Values
Horizontal and vertical.
06
With origin
Works with background-origin.
Fundamentals
Definition and Usage
The background-position CSS property sets the initial position of a background image. It controls the horizontal and vertical placement of the background within the element’s background positioning area.
This is especially useful when the background does not fill the entire element, such as a small icon, badge, texture, or photo positioned in a corner or centered in a hero section.
💡
Beginner Tip
To see background-position clearly, use background-repeat: no-repeat; and a smaller background-size so the image does not cover the whole box.
Foundation
📝 Syntax
Apply background-position using one or two values:
The same background settings can look very different depending on which position value you choose.
🧠 How background-position Works
1
You set a background image
Add an image or gradient with background-image.
Background
2
You choose a position
Use keywords, percentages, or pixel values in background-position.
Placement
3
The browser anchors the image
The background is placed relative to the background positioning area, which can be shaped by background-origin.
Reference box
=
📍
Controlled background layout
You can center hero images, place icons in corners, and fine-tune decorative backgrounds.
Compatibility
Universal Browser Support
background-position is one of the most widely supported CSS properties and works reliably across modern and older browsers.
✓ Baseline · All browsers
Position backgrounds everywhere
Chrome, Firefox, Safari, Edge, and Opera all support keyword, percentage, and length positioning values.
99%Universal support
Google Chrome1+ · Desktop & Mobile
Full support
Mozilla Firefox1+ · Desktop & Mobile
Full support
Apple Safari1+ · macOS & iOS
Full support
Microsoft Edge12+ · All versions
Full support
Opera3.5+ · Modern versions
Full support
Fallback behavior
Invalid position values are ignored, leaving the previous or default top-left placement in effect.
💻
Very old browsersMay not support newer four-value offset syntax
Rare
background-position property99% supported
Bottom line: Use background-position confidently in any web project.
Wrap Up
Conclusion
The background-position property gives you precise control over where background images appear inside an element. Whether you center a hero photo or place a small decorative marker in a corner, this property makes background layout flexible and predictable.
Start with keywords like center and top left, then explore percentages and pixel offsets when you need finer control.
Use center for hero images with background-size: cover;
Combine position with background-repeat and background-size
Use percentages for responsive decorative placement
Test important focal points on mobile and desktop
Pair with background-origin when borders or padding matter
❌ Don’t
Expect visible placement changes when the background fully covers the box
Forget that the default position is top left
Confuse background-position with background-origin
Crop important image content off-screen on small screens
Use pixel offsets everywhere when responsive percentages would work better
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about background-position
Use these points when placing backgrounds in your layouts.
5
Core concepts
📍01
Placement Control
Moves background images.
Purpose
📝02
Keywords
center, top, bottom, left, right.
Values
📊03
Percentages
Relative positioning.
Responsive
⚡04
0% 0% Default
Top-left by default.
Default
🛠05
With Origin
Placement area matters.
Compare
❓ Frequently Asked Questions
The background-position property sets the starting position of a background image within an element. It controls where the background is placed horizontally and vertically.
The initial value is 0% 0%, which places the background at the top-left corner of the background positioning area.
Yes. Common keywords include top, bottom, left, right, and center. You can combine them, such as top left or bottom right.
Keywords are easy preset positions. Percentages position relative to the container size. Pixel values place the background an exact distance from the origin edge.
background-origin defines the positioning area, while background-position places the background image inside that area.