property

grid-area — CSS reference

Shorthand in the order row-start, column-start, row-end, column-end. A single area identifier can select a named area. Unlike margin’s clockwise order, these four values describe start and end lines for both logical axes.

Formal Syntax & Structure

css syntaxcss
<grid-line> [ / <grid-line> ]{0,3}

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>grid-area</title><style>body{margin:0}#g{display:grid;width:300px;grid-template-columns:100px 100px 100px;grid-template-rows:40px 40px;}#g>*{background:#146e73;color:white;box-sizing:border-box}#b{background:#345d8e}#c{background:#79518e}</style><body><div id="g"><div id="a" style="grid-area:1 / 2 / 3 / 4">A</div></div></body></html>
CSS Reference