CSS place-items Property

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

Definition and Usage

The place-items property is a shorthand for align-items and justify-items. It aligns each item inside its grid cell (or along the flex axes) in one declaration.

One value sets both axes. Two values set block first, then inline. It is not place-content, which moves the whole track group. Override one item with place-self.

Standard-track.

Not deprecated. Baseline widely available. Clearest in grid when cells are larger than the items.

Limited support anchor-center

The anchor-center keyword is newer and not ready for everyday use. Prefer center, start, end, and stretch.

CSS Syntax

syntax.css
place-items: <align-items> <justify-items>? | initial | inherit;

First value → align-items. Optional second value → justify-items. If the second is omitted, the first is used for both.

Property Values

ValueDescriptionTry it
centerCenter each item in its cell on both axesTry it
start endBlock axis start; inline axis endTry it
stretchGrow items to fill the cell (when size is auto)Try it
endPack each item toward the end of both axesTry it
initialResets to the longhand initials (normal / legacy)Try it
inheritTakes the parent’s place-itemsTry it

How to Use place-items

Make cells larger than the items, then choose how each item sits in its cell.

  1. Set display: grid (or flex) on the container.
  2. Give tracks or the container enough size that cells have spare room.
  3. Set place-items on the container. It is not inherited.
  4. Override one item with place-self when needed.
PieceRequired?Role
Grid or flex containerYesWhere items are laid out
Cell larger than itemFor positional keywordsWithout spare room, center and end look the same
Auto item sizeFor stretchFixed width/height block stretch
One or two keywordsYesOne value for both axes, or block then inline

Live Preview

Four fixed-size items in larger grid cells. Change only place-items.

Items stay fixed size for positional keywords. stretch drops that fixed size so cells can fill.

Grid
A
B
C
D

place-items: center — Each item sits in the middle of its cell.

CSS Examples

Each snippet focuses on place-items. Use Try It Yourself for a live editor.

Example 1 — Center in Each Cell

One value centers every item inside its grid cell.

CSS
<style>
  section {
    display: grid;
    grid-template-columns: 100px 100px;
    grid-template-rows: 80px 80px;
    place-items: center;
    border: 1px solid #ccc;
  }

  div {
    width: 48px;
    height: 36px;
  }
</style>

<section>
  <div>A</div>
  <div>B</div>
  <div>C</div>
  <div>D</div>
</section>
Try It Yourself

How It Works

  1. Make large cells. Fixed track sizes create room around each item.
  2. Keep items small. Width and height on div stop them from filling the cell.
  3. Use one keyword. place-items: center sets both align-items and justify-items to center.
  4. See each cell. A, B, C, and D sit in the middle of their own cells, not as one group in the container.

Example 2 — Two Different Axes

First value is the block axis. Second value is the inline axis.

CSS
<style>
  section {
    display: grid;
    grid-template-columns: 100px 100px;
    grid-template-rows: 80px 80px;
    place-items: start end;
    border: 1px solid #ccc;
  }

  div {
    width: 48px;
    height: 36px;
  }
</style>

<section>
  <div>A</div>
  <div>B</div>
  <div>C</div>
  <div>D</div>
</section>
Try It Yourself

How It Works

  1. Keep the same grid. Track and item sizes match Example 1 so only the shorthand changes.
  2. First keyword is block. start is align-items (top of each cell in horizontal writing).
  3. Second keyword is inline. end is justify-items (right edge of each cell in LTR).
  4. Result. Every item hugs the top-right corner of its own cell.

Example 3 — Stretch to Fill

Leave item size auto so stretch can fill each cell.

CSS
<style>
  section {
    display: grid;
    grid-template-columns: 100px 100px;
    grid-template-rows: 80px 80px;
    place-items: stretch;
    border: 1px solid #ccc;
  }
</style>

<section>
  <div>A</div>
  <div>B</div>
  <div>C</div>
  <div>D</div>
</section>
Try It Yourself

How It Works

  1. No fixed item size. The children have no width or height, so stretch can work.
  2. Same large cells. Tracks still define 100×80 boxes.
  3. Fill both axes. place-items: stretch grows each item to the cell size.
  4. Contrast with center. Add a fixed size again and switch to center to see the spare room return.

Edge Cases & Pitfalls

If items do not move, one of these is usually why.

size

Items as large as the cell hide positional keywords

If an item already fills its cell, center and end look identical. Use a smaller item size to see the effect.

stretch

Fixed size blocks stretch

A set width or height on the item wins. Leave those as auto when you want the item to fill the cell.

content

Not the same as place-content

place-content moves the track group. place-items moves each item inside its cell.

self

One item can override the container

place-self (or align-self / justify-self) on a child beats the container’s place-items.

order

Remember block then inline

place-items: start end is not the same as end start. First = align-items, second = justify-items.

Browser Support

place-items is a browser layout property for flex and grid. Node.js, Deno, and Bun do not apply it.

✓ Baseline · Widely available since Jan 2020

place-items

Chrome 59+, Firefox 45+, Safari 11+, Edge 79+, Opera 46+, Samsung Internet 7.2+. Internet Explorer has no support.

97% Modern browser support
Google Chrome 59+
Full support
Mozilla Firefox 45+
Full support
Apple Safari 11+
Full support
Microsoft Edge 79+
Full support
Opera 46+
Full support
Samsung Internet 7.2+
Full support
Internet Explorer No support
None
place-items Widely supported

Bottom line: Safe in current browsers for common keywords. For Internet Explorer, set align-items and justify-items as separate longhands. Treat anchor-center as progressive enhancement.

Key Takeaways

  • Role: shorthand for aligning each item in its cell (align-items + justify-items).
  • Common values: center, start end, stretch, end.
  • Initial value: follows the longhands (normal / legacy). Not inherited.
  • Contrast: place-items aims each item; place-content aims the whole track group.

One line: place-items: center is the quick way to center every grid item in its cell.

Frequently Asked Questions

It is a shorthand for align-items and justify-items. It aligns each item inside its grid cell (or along the flex cross and main axes) in one declaration.
place-items aligns each item in its own cell. place-content packs or spreads the whole group of tracks or flex lines inside the container.
A single value sets both align-items and justify-items. For example, place-items: center centers every item in its cell on both axes.
The first value is align-items (block axis). The second is justify-items (inline axis). Example: place-items: start end.
A fixed width or height on the item blocks stretch on that axis. Leave the size as auto if you want the item to fill the cell.
It is Baseline and widely available since January 2020: Chrome 59+, Firefox 45+, Safari 11+, Edge 79+. Internet Explorer does not support it. It is a browser layout property, not a Node.js feature.

Next: place-self

Learn how to override alignment for a single item.

place-self 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