Justify Self Property

Last updated: 2026-09-13

justify-self Justify Self Property

The justify-self property sets the inline axis alignment of a single item, overriding the container’s justify-items default. It applies mainly to grid layouts and has no effect in flexbox. With it, one item can align independently inside its cell without affecting how the other items align.

Category
Initial Valueauto
InheritedNo
Applies To
Animation Type
CSS VersionCSS3
StatusStandard

📝 Syntax

justify-self: auto | normal | stretch | start | end | self-start | self-end | center | left | right | baseline;

⚙️ Values

ValueTypeDescription
auto | normal | stretch | start | end | center | left | rightKeywordSingle item inline axis alignment

▶ Example

Edit the code below and see the live result in the playground:

🌐 Browser Support

Browser ChromeChrome EdgeEdge FirefoxFirefox SafariSafari OperaOpera
justify-self v29 v12 v28 v9 v17
Supported in all major browsers
Warning: justify-self has no effect in flexbox; it only applies to grid. In a flex layout, use align-self to align a single item on the cross axis.
Tip: justify-self: auto inherits the container’s justify-items setting; justify-self: normal behaves like stretch.

❓ FAQ

QWhat is the difference between justify-self and justify-items?
Ajustify-items is set on the grid container and specifies the default horizontal alignment of every grid item. justify-self is set on a single grid item and overrides that item’s default. The default of justify-self is auto, which simply inherits justify-items from the container, so an unset item always follows the container default. justify-self has higher priority than justify-items, which is ideal when a few items need a special alignment inside their cells while the rest keep the default.
QWhy doesn’t justify-self work in flexbox?
AFlexbox has no grid cells; the items sit directly in the container, so justify-self has nothing to apply to. In flexbox, aligning a single item is usually done with margin: auto or with a nested flex container, for example justify-content: space-between combined with margin-left: auto to push one item to the right. If you only need to push one item to the far edge, the auto margin trick is often simpler and works in every flex-capable browser.
QWhat is the difference between justify-self: center and margin: auto?
Ajustify-self: center is the alignment provided by the Box Alignment spec and centers the grid item horizontally within its cell. margin: auto achieves the same visual result because the auto margins absorb the leftover space, but in grid it also absorbs space on both sides, which can fight with other alignment values. justify-self has clearer semantics, keeps the two axes independent, and also supports start, end, stretch and other keywords, so it is the recommended way inside grid layouts.

📚 Related Tutorials

Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏