The background-position-y property controls the vertical placement of a background image. It lets you move a background up or down without changing its horizontal position.
01
Vertical Axis
Move backgrounds up and down.
02
Keywords
top, center, bottom.
03
Percentages
Relative y placement.
04
Pixels
Exact top offsets.
05
With position-x
Split axis control.
06
Shorthand
Related to background-position.
Fundamentals
Definition and Usage
The background-position-y CSS property sets the vertical starting position of a background image. It affects placement along the y-axis only, leaving the horizontal position to background-position-x or the shorthand background-position.
This is useful when you want to align a decorative icon, badge, or photo to the top, center, or bottom while keeping horizontal placement unchanged.
💡
Beginner Tip
Use a small non-repeating background with a fixed background-size so vertical movement is easy to see.
Foundation
📝 Syntax
Apply background-position-y to control vertical background placement:
The initial value of background-position-y is 0%, which places the background at the top edge of the background positioning area. The keyword top produces the same result.
Reference
💎 Property Values
These are the most common ways to set vertical background placement with background-position-y.
Value
Example
Meaning
top
background-position-y: top;
Aligns the background to the top edge
center
background-position-y: center;
Centers the background vertically
bottom
background-position-y: bottom;
Aligns the background to the bottom edge
Percentage
background-position-y: 50%;
Positions relative to element height
Length
background-position-y: 24px;
Offsets the background by an exact distance from the top
top
Places the background at the top edge of the positioning area.
Default-like alignment.
center
Centers the background vertically inside the element.
Common for hero images.
bottom
Aligns the background to the bottom edge.
Useful for footer badges.
75%
Moves the background toward the bottom using a percentage.
Responsive vertical placement.
Compare
background-position-y vs background-position
Property
Controls
Best for
background-position-y
Vertical background placement only
Top/center/bottom alignment without changing x-axis
background-position
Both horizontal and vertical placement
One-line positioning such as center bottom
background-position-x
Horizontal background placement only
Left/center/right alignment without changing y-axis
Preview
👀 Live Preview
These panels keep the same horizontal position and change only the vertical value:
top
center
bottom
background-position-x: center; stays the same in all three panels.
Hands-On
Examples Gallery
Try background-position-y with bottom placement, top/bottom keywords, pixel offsets, and a multi-value comparison.
📚 Vertical Placement
Control where a background sits along the y-axis while horizontal placement stays separate.
Example 1 — Position at the Bottom
Place a background at the bottom of an element while keeping it centered horizontally.
Only the vertical value changes, so the marker moves up and down while staying horizontally centered.
🧠 How background-position-y Works
1
You add a background image
Set an image or gradient with background-image.
Background
2
You set the y-axis position
Use background-position-y with top, center, bottom, percentages, or pixels.
Vertical rule
3
Horizontal placement stays separate
Control the x-axis with background-position-x or the shorthand background-position.
Split axes
=
↕
Precise vertical control
You can align backgrounds to the top, center, or bottom without affecting horizontal placement.
Compatibility
Universal Browser Support
background-position-y is supported in all modern browsers and works reliably for vertical background placement.
✓ Baseline · Modern browsers
Control vertical background placement today
Chrome, Firefox, Safari, Edge, and Opera support keyword, percentage, and length values.
98%Modern browser support
Google Chrome1+ · Desktop & Mobile
Full support
Mozilla Firefox49+ · Desktop & Mobile
Full support
Apple Safari15+ · macOS & iOS
Full support
Microsoft Edge12+ · Modern versions
Full support
Opera36+ · Modern versions
Full support
Fallback behavior
In older browsers, use the shorthand background-position as a fallback when split-axis properties are unavailable.
💻
Legacy browsersMay require background-position instead of split x/y properties
Fallback
background-position-y property98% supported
Bottom line: Use background-position-y confidently in modern projects, especially with background-position-x for split-axis control.
Wrap Up
Conclusion
The background-position-y property gives you direct control over vertical background placement. It is especially useful when you want to align an image to the top, center, or bottom without changing its horizontal position.
Pair it with background-position-x for full two-axis control, or use background-position when a single shorthand declaration is enough.
Use top, center, and bottom for simple vertical alignment
Pair with background-position-x when axes need separate control
Use percentages for responsive vertical placement
Keep non-repeating backgrounds small when teaching placement
Provide a background-position fallback for older browsers if needed
❌ Don’t
Confuse background-position-y with the full shorthand property
Expect visible movement when the background fully covers the element
Forget that the default vertical position is top (0%)
Change x and y in separate places when shorthand would be simpler
Ignore focal points on responsive hero images
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about background-position-y
Use these points when placing backgrounds vertically.
5
Core concepts
↕01
Vertical Only
Controls the y-axis.
Purpose
📝02
Keywords
top, center, bottom.
Values
📊03
Percentages
Responsive y placement.
Responsive
⚡04
0% Default
Top edge by default.
Default
🛠05
With position-x
Split axis control.
Compare
❓ Frequently Asked Questions
The background-position-y property sets the vertical position of a background image. It controls placement along the y-axis without changing the horizontal position.
The initial value is 0%, which places the background at the top edge of the background positioning area. This is equivalent to the top keyword.
Yes. The common keywords are top, center, and bottom.
background-position-y controls only the vertical axis. background-position can set both horizontal and vertical placement in one declaration.
Yes. You can use both properties together to control vertical and horizontal placement separately.