concept
Grid percentage gaps — CSS reference
A percentage gap resolves against the content box in its respective axis. In grid intrinsic sizing, cyclic percentage gaps contribute zero; they can still resolve against the final content size when laying out items, potentially overflowing. Here the definite inline size makes the gap 30px.
Formal Syntax & Structure
css syntaxcss
gap: 10%;Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>grid-percentage-gaps</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:1fr 1fr;column-gap:10%}</style><body><div id="g"><div id="a">A</div><div id="b">B</div></div></body></html>