CSS justify-self Property

Beginner
6 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The justify-self property sets how one item is justified inside its alignment container on the inline axis. In grid, that is left–right placement inside the item’s grid area.

Put it on the item, not the container. The default auto follows the container’s justify-items. It is ignored in flexbox and table cells. For the block axis on one item, use align-self.

Standard-track.

Not deprecated. Grid support is widely available (Baseline since 2017). anchor-center is newer and limited—prefer auto, stretch, center, start, and end for study.

CSS Syntax

syntax.css
justify-self: auto | normal | stretch | center | start | end | initial | inherit;

Also valid: left, right, self-start, self-end, baseline, and optional safe / unsafe.

Property Values

ValueDescriptionTry it
autoDefault. Follow the parent’s justify-itemsTry it
stretchGrow an auto-sized item to fill the cell on the inline axisTry it
centerPack this item toward the center of its cellTry it
startPack this item toward the start edge of its cellTry it
endPack this item toward the end edge of its cellTry it
normalIn grid, usually acts like stretch (except some intrinsic boxes)Try it
initialResets to autoTry it
inheritTakes the parent’s justify-self (not inherited by default)Try it

How to Use justify-self

Set a container default with justify-items, then override one item when it should sit differently.

  1. Build a grid with cells wider than the item content.
  2. Optionally set justify-items on the container (for example stretch).
  3. Pick the item that should differ.
  4. Set justify-self on that item only (center, start, end, …).
PieceRequired?Role
Grid itemYesWhere justify-self is declared
Cell larger than contentYes (for position keywords)Without spare cell width, center looks like stretch
Container justify-itemsOptionalDefault for siblings; auto on the item follows it

Live Preview

Neighbors stretch. The highlighted item alone changes with justify-self.

Container uses justify-items: stretch. Only the blue item is overridden.

Grid
One
Two
Three
Four

justify-self: center

CSS Examples

Each snippet keeps only what justify-self needs: a grid, stretching siblings, and one override. Use Try It Yourself for a live editor.

Example 1 — Center One Item

Siblings stretch; only the second item centers in its cell.

CSS
<style>
  section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-items: stretch;
    border: 1px solid #ccc;
  }
  .spot {
    justify-self: center;
  }
</style>

<section>
  <div>One</div>
  <div class="spot">Two</div>
  <div>Three</div>
  <div>Four</div>
</section>
Try It Yourself

How It Works

  1. Container default. justify-items: stretch fills each cell for normal items.
  2. Override one child. justify-self: center applies only to .spot.
  3. Content width. That item shrinks to its content and sits in the middle of its cell.
  4. Siblings unchanged. One, Three, and Four still stretch.

Example 2 — Start One Item

Pin a single item to the start edge while others stretch.

CSS
<style>
  section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-items: stretch;
    border: 1px solid #ccc;
  }
  .spot {
    justify-self: start;
  }
</style>

<section>
  <div>One</div>
  <div class="spot">Two</div>
  <div>Three</div>
  <div>Four</div>
</section>
Try It Yourself

How It Works

  1. Same default. The grid still stretches items by default.
  2. Start packing. justify-self: start hugs the inline-start edge (left in LTR).
  3. Spare space. Unused cell width sits on the end side of that item only.
  4. Study tip. Compare with auto: auto would stretch again because it follows justify-items.

Example 3 — End One Item

Push one item to the end edge of its grid area.

CSS
<style>
  section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-items: stretch;
    border: 1px solid #ccc;
  }
  .spot {
    justify-self: end;
  }
</style>

<section>
  <div>One</div>
  <div class="spot">Two</div>
  <div>Three</div>
  <div>Four</div>
</section>
Try It Yourself

How It Works

  1. One keyword change. Only end differs from the previous examples.
  2. End packing. The item aligns to the inline-end edge of its cell.
  3. Still an override. Neighbors keep the container’s stretch default.
  4. Both axes. Pair with align-self, or use place-self as a shorthand.

Edge Cases & Pitfalls

If the override is invisible, the item may already fill the cell—or you may be in flex layout.

flex

Ignored in flexbox

justify-self has no effect on flex items. Use align-self (cross axis) or margins for one-off flex placement.

auto

auto is not a position

auto means “use the container’s justify-items.” If the container stretches, auto stretches too.

width

Fixed width blocks stretch

A set width on the item prevents stretch from growing it. Position keywords still need spare cell space to look different.

vs

Not justify-content

justify-content moves tracks inside the container. justify-self moves one item inside its cell.

place

Shorthand: place-self

place-self sets align-self and justify-self together when both axes should change on one item.

Browser Support

justify-self is a browser layout property (mainly CSS Grid). Node.js, Deno, and Bun do not apply it.

✓ Baseline · Widely available since 2017

justify-self

Chrome 57+, Firefox 45+, Safari 10.1+, Edge 16+. Internet Explorer has no grid justify-self support.

96% modern browsers
Google Chrome 57+
Full support
Mozilla Firefox 45+
Full support
Apple Safari 10.1+
Full support
Microsoft Edge 16+
Full support
Opera 44+
Full support
Samsung Internet 6.2+
Full support
Internet Explorer No support
None
justify-self Widely supported

Bottom line: Safe for modern grid layouts. Stick to auto, stretch, center, start, and end for the simplest study path. Newer keywords like anchor-center need extra care.

Key Takeaways

  • Role: override inline-axis alignment for one item inside its area.
  • Default auto: follows the container’s justify-items.
  • Best with grid: ignored in flexbox; teach it on a grid item.
  • Pair: align-self for the other axis, or place-self for both.

One line: justify-self is the per-item override of justify-items on the inline axis.

Frequently Asked Questions

It sets how one item is justified inside its alignment container on the inline axis. In grid, that means one item’s left–right placement inside its cell.
The initial value is auto. The item then follows the parent’s justify-items value (or normal if there is no parent / for some absolute cases).
justify-items is the container default for all items. justify-self overrides that default on a single item.
justify-self is the inline axis (left–right in LTR). align-self is the block / cross axis (top–bottom in a row grid).
No. In flex layout the property is ignored. Use align-self or margin tricks instead for one flex item.
Widely available for grid: Chrome 57+, Firefox 45+, Safari 10.1+, Edge 16+. It is a browser layout property, not a Node.js feature.

Next: left

Offset a positioned element from the left edge of its containing block.

left tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful