Complete the code to create a grid container with 3 columns using Tailwind CSS.
<div class="grid grid-cols-[1] gap-4"> <div class="bg-blue-500">Item 1</div> <div class="bg-green-500">Item 2</div> <div class="bg-red-500">Item 3</div> </div>
The class grid-cols-3 sets the grid to have 3 columns.
Complete the code to create a grid with 4 columns and a gap of 6 using Tailwind CSS.
<div class="grid grid-cols-[1] gap-[2]"> <div class="bg-yellow-400">Item A</div> <div class="bg-pink-400">Item B</div> <div class="bg-purple-400">Item C</div> <div class="bg-indigo-400">Item D</div> </div>
The class grid-cols-4 sets 4 columns, and gap-6 sets the gap size between grid items.
Fix the error in the code to make the grid automatically create columns with a minimum width of 10rem using Tailwind CSS.
<div class="grid grid-cols-[1] gap-4"> <div class="bg-gray-300">Box 1</div> <div class="bg-gray-400">Box 2</div> <div class="bg-gray-500">Box 3</div> </div>
repeat() wrapper.In Tailwind CSS, to use custom grid-template-columns with repeat(auto-fill, minmax) for responsive implicit grid sizing, you wrap the valid CSS value in square brackets: grid-cols-[repeat(auto-fill,minmax(10rem,1fr))] is correct.
Fill both blanks to create a grid that automatically fits columns with a minimum width of 12rem and a gap of 8.
<div class="grid grid-cols-[1] gap-[2]"> <div class="bg-red-200">Item 1</div> <div class="bg-red-400">Item 2</div> <div class="bg-red-600">Item 3</div> <div class="bg-red-800">Item 4</div> </div>
repeat() in the grid columns value.The class grid-cols-[repeat(auto-fit,minmax(12rem,1fr))] sets the grid to automatically fit columns with a minimum width of 12rem. The class gap-8 sets the gap size between items.
Fill all three blanks to create a responsive grid that uses auto-fill with a minimum column width of 14rem, a gap of 10, and a background color of blue-100.
<div class="grid grid-cols-[1] gap-[2] bg-[3]"> <div>Box A</div> <div>Box B</div> <div>Box C</div> <div>Box D</div> </div>
repeat() for the custom grid columns.The class grid-cols-[repeat(auto-fill,minmax(14rem,1fr))] sets the grid to auto-fill columns with a minimum width of 14rem. The class gap-10 sets the spacing between grid items. The class bg-blue-100 sets a light blue background color.