What problem does this tool solve?
A directory needs flexible cards whose width remains readable at different container sizes. Start from the content box and gap rather than the viewport.
Ten practical questions answered
How do I calculate the maximum fitting tracks?
Take floor((content width + gap)/(minimum track width + gap)), with at least one track.
Why are there fewer gaps than columns?
There is one column gap between each adjacent pair, so n tracks use n minus one gaps.
Should I enter the viewport width?
Use the grid's content width after surrounding layout and padding, not the full viewport.
How is extra width shared?
For equal 1fr tracks, divide the width remaining after gaps among the occupied tracks.
What if there are only two cards but four tracks would fit?
auto-fit can collapse empty tracks, so occupied cards may be wider than this capacity estimate.
How does the CSS handle a very narrow container?
The generated minimum uses min(100%, requested width), allowing one track to shrink. Oversized inner content can still overflow.
Can I plan edge-to-edge cards without a gap?
Yes. Set gap to zero and the calculation uses the container width divided by the desired minimum.
Does this also calculate image height?
No. Use the separate aspect ratio planner once you know the card width.
Will this prove a layout has no CLS?
No. It estimates track geometry and does not measure cumulative layout shift.
How should I verify the resulting CSS?
Try the declaration on a test layout, inspect computed track sizes at representative widths and check long content.
How it works, with an example
Enter all three dimensions. With enough cards, take the integer part of (container width + gap) / (minimum track + gap), at least one. Divide the width remaining after gaps among the columns. The CSS output caps the minimum at 100% for narrow containers.
Practical example
A 760px container with a 220px minimum and 20px gap fits three columns. After two gaps, each track is 240px wide.
Additional use cases
- Compare directory cards at two measured container widths.
- Plan readable card widths before implementing a layout.
Technical reference: MDN · CSS grid layout
Frequently asked questions
Does the tool crawl a website?
No. It only uses your entered dimensions.
What dimensions are valid?
Whole CSS-pixel widths from 1–999999 and gaps from 0–999999.
Does this measure actual cards?
No. This is a geometric capacity estimate assuming enough cards.
Related tools for your next step
Review responsive cards
Record affected container widths and the intended card dimensions.
Request a free consultation (German form) →SEOSTUDIO editorial team · Updated