You're experiencing issues using auto-fit in a CSS grid within Webflow even after removing all fr
, vh
, or percentage-based units. This typically points to a grid setup conflict that prevents auto-fit from behaving correctly.
1. Check for Fixed Widths on Grid Children
- Auto-fit needs flexible child elements to respond to content or available space.
- If a grid child has a fixed width, Webflow may not allow auto-fit to engage.
- Inspect all grid child elements to ensure no fixed widths (e.g., 200px) are applied via style panel.
2. Confirm Column Definitions
- Ensure your grid columns are using
auto
or minmax()
with auto-fit
or auto-fill
. - Webflow may not enable auto-fit unless a minmax() function is structured properly, like:
minmax(200px, 1fr)
with auto-fit applied.
3. Verify the Display Setting
- Confirm that the section using the grid has its Display set to Grid and not Flex or Block.
- Sometimes switching display modes can reset or lock out certain grid options.
4. Use of Auto-Fit Requires Min-Max
- Webflow only enables auto-fit when used with minmax() to define grid tracks.
- For example, instead of just selecting auto-fit, you must combine it with a track size like:
auto-fit + minmax(150px, 1fr)
5. Potential Bug or UI Delay
- Webflow’s UI might not update immediately after removing previously conflicting units.
- Try refreshing the Designer or fully reloading the browser. If using Chrome, clear Designer cache with Cmd+Shift+R (Ctrl+Shift+R on Windows).
6. Grid Nested Inside Another Grid/Flex
- If your grid is inside another grid or a flexbox container, constraints from the parent may prevent auto-fit from functioning.
- Test the grid in a standalone section to see if the issue persists.
Summary
To resolve the issue with auto-fit not appearing in Webflow: ensure all grid child elements are size-flexible (no fixed widths), define grid columns using minmax() in combination with auto-fit, and check for any styling conflicts or nesting restrictions. Refresh the Designer if behavior seems inconsistent.