Loading...
Interactive grid builder. Customize columns, gaps, and generate CSS Grid code instantly.
Enables responsive auto-fit grid (sm breakpoint and up)
<div class="grid grid-cols-3 gap-4">
<div class="p-4 bg-blue-500 text-white rounded">Item 1</div>
<div class="p-4 bg-blue-500 text-white rounded">Item 2</div>
<div class="p-4 bg-blue-500 text-white rounded">Item 3</div>
<div class="p-4 bg-blue-500 text-white rounded">Item 4</div>
<div class="p-4 bg-blue-500 text-white rounded">Item 5</div>
<div class="p-4 bg-blue-500 text-white rounded">Item 6</div>
</div>Create a basic grid with equal-width columns.
<div class="grid grid-cols-3 gap-4">
<div class="p-4 bg-blue-500 text-white rounded">1</div>
<div class="p-4 bg-blue-500 text-white rounded">2</div>
<div class="p-4 bg-blue-500 text-white rounded">3</div>
</div>Use responsive prefixes to change the number of columns at different breakpoints.
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4">
<div class="p-4 bg-blue-500 text-white rounded">1</div>
<div class="p-4 bg-blue-500 text-white rounded">2</div>
<div class="p-4 bg-blue-500 text-white rounded">3</div>
<div class="p-4 bg-blue-500 text-white rounded">4</div>
</div>Create a responsive grid that automatically adjusts columns based on minimum item width.
<div class="grid grid-cols-[repeat(auto-fit,minmax(200px,1fr))] gap-4">
<div class="p-4 bg-blue-500 text-white rounded">1</div>
<div class="p-4 bg-blue-500 text-white rounded">2</div>
<div class="p-4 bg-blue-500 text-white rounded">3</div>
</div>Make items span multiple columns.
<div class="grid grid-cols-3 gap-4">
<div class="col-span-2 p-4 bg-blue-500 text-white rounded">Spans 2 columns</div>
<div class="p-4 bg-blue-500 text-white rounded">1</div>
<div class="col-span-3 p-4 bg-blue-500 text-white rounded">Spans 3 columns</div>
</div>Make items span multiple rows.
<div class="grid grid-cols-2 grid-rows-3 gap-4">
<div class="row-span-2 p-4 bg-blue-500 text-white rounded">Spans 2 rows</div>
<div class="p-4 bg-blue-500 text-white rounded">1</div>
<div class="p-4 bg-blue-500 text-white rounded">2</div>
<div class="p-4 bg-blue-500 text-white rounded">3</div>
</div><!-- Small gap -->
<div class="grid grid-cols-3 gap-2">...</div>
<!-- Medium gap (default) -->
<div class="grid grid-cols-3 gap-4">...</div>
<!-- Large gap -->
<div class="grid grid-cols-3 gap-8">...</div>
<!-- Gap X and Y separately -->
<div class="grid grid-cols-3 gap-x-4 gap-y-8">...</div>