CKTIS / CSS
fr — flexible grid track unit
The fr unit distributes leftover space among CSS Grid tracks, subject to flex factors and sizing constraints.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
<number [0,∞]>frfr denotes a nonnegative CSS Grid track flex factor. Leftover space, after non-flexible tracks and gaps, is shared proportionally: 1fr 2fr gives a 1:2 ratio when track minimums permit.
Bare 1fr means minmax(auto, 1fr), so content can enforce a larger minimum. minmax(0, 1fr) removes that automatic minimum but does not prevent content overflow. When flex factors total less than 1, some space may remain unused, but track minimums can take up all the available space. For example, a single minmax(100px, 0.5fr) track fills a grid that is 100px wide.
fr is not a <length>: width: 1fr is invalid. In minmax(), it can specify the maximum, not the minimum.
Examples
<!doctype html>
<meta charset="utf-8">
<style>
#grid {
display: grid;
width: 620px;
gap: 10px;
grid-template-columns: 100px minmax(0, 1fr) minmax(0, 2fr);
}
</style>
<div id="grid"><div>A</div><div>B</div><div>C</div></div>
<pre id="result"></pre>
<script>
const grid = document.getElementById('grid');
const widths = [...grid.children].map(item =>
item.getBoundingClientRect().width
);
document.getElementById('result').textContent = JSON.stringify(widths);
</script>Result
[100,166.65625,333.34375]
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.