Complete the code to center items both horizontally and vertically using Tailwind CSS.
<div class="grid h-64 [1]"> <div class="bg-blue-500 text-white p-4">Centered Box</div> </div>
items-center centers vertically but not horizontally.justify-center centers horizontally but not vertically.The place-items-center class centers items both horizontally and vertically inside a grid or flex container.
Complete the code to align items at the start horizontally and center vertically using Tailwind CSS.
<div class="flex h-64 [1] [2]"> <div class="bg-green-500 text-white p-4">Aligned Box</div> </div>
items- and justify- classes.place-items-start which affects both axes but is not correct here.items-center centers items vertically, and justify-start aligns items to the start horizontally.
Fix the error in the code to properly center items using Tailwind CSS.
<div class="grid h-64 [1]"> <div class="bg-red-500 text-white p-4">Fixed Box</div> </div>
items-center in a grid container which only affects vertical alignment in flexbox.justify-center alone which only aligns horizontally.For grid containers, place-items-center centers items both horizontally and vertically.
Fill both blanks to align items at the end horizontally and start vertically using Tailwind CSS.
<div class="flex h-64 [1] [2]"> <div class="bg-yellow-500 text-black p-4">Aligned Box</div> </div>
place-items-end which affects both axes but is not correct here.content-start which affects content alignment, not items.items-start aligns items at the top vertically, and justify-end aligns items at the end horizontally.
Fill all three blanks to create a grid container that centers items horizontally, aligns them at the start vertically, and uses a gap of 4.
<div class="grid h-64 gap-4 [1] [2] [3]"> <div class="bg-purple-500 text-white p-4">Grid Box</div> </div>
items-center which is for flexbox, not grid.place-items-center which centers both axes, not start vertically.place-items-start aligns items vertically at start, justify-center centers horizontally, and content-start aligns grid content at the start.