grid shorthand
W3C CSS Snapshot 2026
Set explicit or implicit grid properties. The shorthand resets omitted template and auto-placement properties to their initial settings.
On this page
Syntax and values
| Value or syntax | What it does |
|---|---|
none | Resets the grid template and implicit settings. |
40px 70px / 1fr 2fr | Sets explicit rows and columns, like grid-template. |
auto-flow 60px / 1fr 1fr | Fills rows and uses 60px for implicit rows with two explicit columns. |
60px 60px / auto-flow 80px | Fills columns and uses 80px for implicit columns with two explicit rows. |
Try the example
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>grid example</title>
<style>
.layout { display: grid; width: min(100%, 320px); border: 2px solid teal; box-sizing: border-box; }
.layout > div { padding: 8px 12px; background: #def5f5; color: #123; border: 1px solid #81b9b5; box-sizing: border-box; }
.layout { grid: auto-flow 60px / 1fr 1fr; }
</style>
</head>
<body>
<div class="layout">
<div class="first">A</div>
<div class="second">B</div>
<div>C</div>
</div>
</body>
</html>
What to expect There are two columns, and each new row is 60px tall.