property
justify-items — CSS reference
Sets the default justify-self value for grid items. Initial legacy; not inherited. In Grid it aligns each item in its own area on the inline axis, not the collection of tracks. Explicit item sizes and auto margins affect the result.
Formal Syntax & Structure
css syntaxcss
normal | stretch | <self-position> | <overflow-position> <self-position> | …Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>justify-items</title><style>body{margin:0}#g{display:grid;width:300px;grid-template-columns:100px 100px 100px;grid-template-rows:40px 40px;justify-items:center;}#g>*{background:#146e73;color:white;box-sizing:border-box}#b{background:#345d8e}#c{background:#79518e}</style><body><div id="g"><div id="a" style="width:40px">A</div></div></body></html>