CSS Portal

CSS place-items Property

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!

Description

The place-items property is a convenience shorthand that sets how child boxes are positioned within their allotted grid or layout areas by combining the two axis-specific alignment properties: align-items (block-axis alignment) and justify-items (inline-axis alignment). Using this shorthand lets you express both axes’ alignment in one declaration, which is especially useful when you want consistent placement across both axes without repeating properties. Because it maps to the block and inline axes, its effective directions follow the document’s writing mode and text direction, so a single declaration adapts when switching between horizontal and vertical or right-to-left flows.

In practice, place-items determines the default alignment behavior for children but does not lock items from being individually positioned; item-level overrides such as align-self and justify-self take precedence for a single child. There is also a corresponding shorthand for per-item alignment, place-self, which mirrors the container shorthand at the item level. Be mindful that not every layout system honors both axes the same way: for example, some flex layouts do not use the inline-axis property in the same manner as grid, so one component of the shorthand may have no effect in certain contexts.

Beyond simple alignment, place-items is useful when you want to keep container-level alignment and content-distribution concerns separate; compare it to the related container-level shorthand place-content, which controls space distribution between tracks or lines rather than the alignment of items inside their individual areas. Choosing place-items simplifies maintenance and responsive adjustments - a single change can realign items on both axes at once - and helps ensure predictable behavior across different writing modes and orientations, as long as you account for layout-specific exceptions and item-level overrides.

Definition

Initial value
See individual properties
Applies to
All elements
Inherited
No
Computed value
See individual properties
Animatable
Yes
JavaScript syntax
object.style.placeItems

Interactive Demo

One
Two
Three

Syntax

place-items: <align-items> <justify-items>?

Values

Example

<div class="container">
<div class="centered-box">
<p>Center Me!</p>
</div>
</div>
.container {
  display: grid;
  /* Shorthand for align-items and justify-items */
  place-items: center; 
  
  /* Styling for visibility */
  height: 300px;
  background-color: #f0f0f0;
  border: 2px dashed #ccc;
}

.centered-box {
  padding: 20px 40px;
  background-color: #007bff;
  color: white;
  border-radius: 8px;
  font-family: sans-serif;
}

Browser Support

The following information will show you the current browser support for the CSS place-items property. Hover over a browser icon to see the version that first introduced support for this CSS property.

This property is supported by all modern browsers.
Desktop
Chrome
Edge
Firefox
Opera
Safari
Tablets & Mobile
Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-

Last updated by CSSPortal on: 1st January 2026

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!