concept

Grid stretch auto tracks — CSS reference

After flexible expansion, positive definite leftover space can be shared equally among tracks with an auto maximum if content alignment is normal or stretch. This is track growth, distinct from stretching items inside existing areas.

Formal Syntax & Structure

css syntaxcss
justify-content: stretch;

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>grid-stretch-auto-tracks</title><style>body{margin:0}#g{display:grid;width:300px;grid-template-columns:100px 1fr;grid-auto-rows:40px;justify-content:start;align-content:start;background:#e8edf1}#g>*{background:#126f70;color:white}#b{background:#325d8c}#g{grid-template-columns:auto 100px;justify-content:stretch}#a>div{width:40px}</style><body><div id="g"><div id="a"><div>A</div></div><div id="b">B</div></div></body></html>
CSS Reference