Complete the code to set the grid to flow items by rows.
<div class="grid [1] gap-4"> <div class="bg-blue-500 p-4">Item 1</div> <div class="bg-green-500 p-4">Item 2</div> <div class="bg-red-500 p-4">Item 3</div> </div>
grid-flow-col which flows items by columns instead of rows.grid-cols-3 with flow direction.The class grid-flow-row makes the grid place items by rows, filling each row before moving to the next.
Complete the code to make the grid flow items by columns.
<section class="grid [1] gap-2"> <div class="bg-yellow-400 p-3">A</div> <div class="bg-purple-400 p-3">B</div> <div class="bg-pink-400 p-3">C</div> </section>
grid-flow-row which flows items by rows.The class grid-flow-col makes the grid place items by columns, filling each column before moving to the next.
Fix the error in the code to correctly place the item in the second column.
<div class="grid grid-cols-3 gap-4"> <div class="bg-gray-300 p-4">Item 1</div> <div class="bg-gray-500 p-4 col-start-[1]">Item 2</div> <div class="bg-gray-700 p-4">Item 3</div> </div>
col-start-1 which places the item in the first column.The class col-start-2 places the item starting at the second column.
Fill both blanks to create a grid with 2 rows and place the item in the second row.
<div class="grid [1] gap-3"> <div class="bg-teal-400 p-3 row-start-[2]">Hello</div> </div>
grid-cols-2 which sets columns, not rows.grid-rows-2 sets the grid to have 2 rows. row-start-2 places the item in the second row.
Fill all three blanks to create a grid flowing by columns with 3 columns and place the item starting at column 3.
<div class="grid [1] [2] gap-2"> <div class="bg-orange-400 p-2 col-start-[3]">Box</div> </div>
grid-flow-row instead of grid-flow-col.grid-flow-col makes the grid flow by columns. grid-cols-3 sets 3 columns. col-start-3 places the item starting at the third column.