The justify-self property lets you override inline-axis alignment for a single grid item inside its cell. It is the item-level companion to justify-items, useful when one box needs different horizontal placement than its neighbors.
01
Item Override
Align one item differently.
02
Syntax
Apply it on the item.
03
auto Value
Inherits justify-items.
04
CSS Grid
Inline axis in cells.
05
Keywords
start, center, end.
06
vs justify-items
One item vs all items.
Fundamentals
Introduction
The justify-self property in CSS is used to align an individual grid item along the inline (row) axis within its grid area. While justify-items sets the default for every item in the container, justify-self lets one item break that rule.
This is helpful for layouts like a product grid where one featured card is centered in its column while the rest stay start-aligned, or a dashboard tile where a badge sits at the trailing edge of its cell.
Definition and Usage
Apply justify-self to a grid item, not to the grid container. Use it when a single item needs a different inline-axis position than the container’s justify-items value provides.
💡
Beginner Tip
Set justify-items on the grid container for the group, then use justify-self only on the item that needs a different alignment. Give items a width smaller than their cell so start, center, and end are visible.
auto is the default. Explicit values like start override the inherited container alignment for that item only.
A11y
♿ Accessibility
Preserve reading order — moving one item visually does not change DOM order for screen readers.
Support RTL layouts — prefer start and end over hard-coded left/right values.
Keep touch targets usable — end-aligned badges and buttons still need adequate tap area.
Test zoom and reflow — centered or edge-aligned items should remain readable at larger text sizes.
Avoid overusing overrides — too many different alignments in one grid can confuse visual scanning.
🧠 How justify-self Works
1
Container sets the default
justify-items on the grid container defines inline-axis alignment for all items.
justify-items
2
Item size is resolved
The browser calculates each item’s inline size before placing it inside its grid area.
Sizing
3
justify-self overrides one item
When set to a keyword other than auto, the item ignores the container default for inline-axis placement.
Override
=
▦
Flexible per-item alignment
One featured card, badge, or icon can stand out without changing alignment for the whole grid.
Compatibility
🖥 Browser Compatibility
justify-self is widely supported in modern browsers for CSS Grid layouts.
✓ Baseline · CSS Grid
Reliable grid item alignment across browsers
Current Chrome, Firefox, Safari, Edge, and Opera all support justify-self on grid items.
97%Modern browser support
Google Chrome57+
Full support
Mozilla Firefox45+
Full support
Apple Safari10.1+
Full support
Microsoft Edge16+
Full support
Opera44+
Full support
justify-self property97% supported
Bottom line: Use justify-self confidently in modern CSS Grid layouts.
Wrap Up
🎉 Conclusion
The justify-self property offers precise control over the inline-axis alignment of individual grid items inside their cells. Whether you need one featured card centered, a badge at the end, or a mix of start, center, and end in the same row, it provides clear keyword values for the job.
For beginners, set justify-items on the container first, then add justify-self only where an item needs to break the default. Remember to give items a width smaller than their cell so alignment changes are visible.
Set justify-items on the container, then override with justify-self sparingly
Use start and end for writing-mode-friendly layouts
Give items width: fit-content or a fixed width when testing alignment
Pair with align-self when you need both axes customized for one item
Use auto when an item should follow the container default
❌ Don’t
Confuse justify-self with justify-items
Apply justify-self to the grid container instead of the item
Override every item when justify-items on the container is enough
Expect alignment to show when items already stretch to full cell width
Replace semantic structure with alignment tricks that harm readability
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about justify-self
Use these points when building CSS Grid layouts.
5
Core concepts
↔01
Item Override
One grid item.
Purpose
auto02
Default
auto.
Values
center03
Featured card
Highlight one tile.
Pattern
grid04
Grid focus
Inline axis.
Scope
items05
Not justify-items
Item vs container.
Compare
❓ Frequently Asked Questions
justify-self overrides the inline-axis alignment of a single grid item inside its grid area. It lets one item break away from the container's justify-items default.
The initial value is auto, which means the item follows the alignment set by the container's justify-items property.
justify-items sets the default inline-axis alignment for all grid items on the container. justify-self overrides that default for one specific item.
justify-self controls inline-axis alignment inside a grid cell. align-self controls block-axis alignment inside the same cell.
Use it when one grid item needs different horizontal placement than its neighbors, such as a featured card centered while others stay at the start.