justify-items
Widely availableSince 201697% of users
Defines the default alignment for all items inside a grid container along the inline (horizontal) axis.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyClassic, with newer partsIt has worked everywhere since July 2016, and it keeps getting newer values.
Newer parts of justify-items
anchor-centerBaseline Jan 2026self-endBaseline Jul 2022, Widely Jan 2025self-startBaseline Jul 2022, Widely Jan 2025centerBaseline Jan 2020, Widely Jul 2022endBaseline Jan 2020, Widely Jul 2022leftBaseline Jan 2020, Widely Jul 2022legacyBaseline Jan 2020, Widely Jul 2022rightBaseline Jan 2020, Widely Jul 2022
See how modern your own CSS is.Check your CSS →
Quick facts
- Initial value
legacy- Inherited
- No
- Applies to
- all elements
- Animation type
- discrete
Quick example
.grid-container {
display: grid;
grid-template-columns: 1fr 1fr;
/* Centers all children horizontally within their grid cells */
justify-items: center;
}Values
normalstretchleftrightlegacycenteranchor-centerjustify-items browser support
BaselineWidely availableThis feature is well established and works across many devices and browser versions. It has been available across browsers since 2016.Safe to use without fallbacks.
Usage97%of people can use this3% use a browser without it.
Browsers
52+
20+
9+
12+Mobile
52+Android
20+Android
9+iOS