grid-cols-1 grid-rows-3 and 5 child items inside. What happens to the extra 2 items that don't fit in the explicitly defined rows?When more items exist than the explicitly defined rows, CSS grid automatically creates implicit rows to fit the extra items. Tailwind's grid-rows-3 sets explicit rows, but extra items go into implicit rows.
auto-cols- prefix for implicit column sizing.The auto-cols-[value] class sets the size of implicit grid columns. So auto-cols-[8rem] sets implicit columns to 8rem wide.
<div class="grid grid-cols-1 grid-rows-2 auto-rows-[100px] gap-2"> <div>1</div> <div>2</div> <div>3</div> </div>
What will be the height of the third grid row that is created implicitly?
auto-rows size.The auto-rows-[100px] class sets the height of implicit rows to 100px. The first two rows are explicit and may have different heights, but the third row is implicit and uses this size.
auto-rows prefix for implicit row sizing.The auto-rows-[value] utility sets the size of implicit grid rows. The grid-rows-[value] sets explicit rows, and implicit-rows or grid-auto-rows are not valid Tailwind classes.
Implicit grid tracks do not automatically provide accessibility features. Developers should add semantic roles like role="grid" and ensure keyboard navigation works properly for all grid items, including those in implicit tracks.