Use fr to give each flexible grid track a share of the available space. The grid accounts for gaps and fixed tracks before sharing the remaining space. The browser recalculates the track sizes when you change the layout.
What's a fraction (1FR)?
1fr is one share of the space available to flexible tracks. If three columns are each 1fr and their contents can shrink, each column receives one third of that space.
How much is 2FR?
2fr requests two shares. Four columns sized 2fr 1fr 1fr 1fr have five shares altogether. The first receives two fifths, and each of the others receives one fifth.
Fractions vs percentages
A percentage track is often sized against the grid container. Gaps need space of their own. With fr, flexible tracks split the space left after the grid accounts for gaps and fixed track sizes. Use fr when you want relative widths in a grid that also has gaps.
Let's use percentages
In a 1200 px container, four 25% columns are 300 px each. They already use the full 1200 px. Add three 16 px gaps and the total becomes 1248 px, so the grid overflows its container. Adding or removing a column also changes the percentages needed to fit the layout.
Share the remaining space with fr
Keep the same 1200 px container and three 16 px gaps. The tracks can use 1152 px. With four 1fr columns, each gets 288 px. Change the first column to 2fr and the browser splits the same available width in a 2:1:1:1 ratio.
So, what is 1FR equal to?
When minimum track sizes allow the requested proportions, divide the remaining width by the total number of shares. If the first column is fixed at 200 px and the other three are 1fr, keep the three 16 px gaps. Each flexible column is about 317.3 px, calculated as (1200 − 200 − 3 × 16) ÷ 3.
1FR and content
A column set to 1fr has an automatic minimum. A fixed-width image or an unbreakable line of text can keep one column from shrinking and cause the columns to have different widths. Preview the grid at a narrow width and check that images can shrink and long text can wrap.
Min/Max
Use Min/Max sizing to set the lower and upper bounds for a track. In CSS, minmax(0, 1fr) lets a flexible track shrink below its automatic minimum. Handle overflow for the images and text inside it as well. For a row that stays at least 5% of the viewport height and can grow with its content, set the minimum to 5vh and the maximum to auto.

