Complete the code to make the container a flexbox using Tailwind CSS.
<div class="[1] p-4 bg-gray-100"> <p>This is a flex container.</p> </div>
The flex class in Tailwind CSS makes the container a flexbox, enabling flexible layouts.
Complete the code to make the container a grid using Tailwind CSS.
<section class="[1] gap-4 p-4"> <div>Item 1</div> <div>Item 2</div> </section>
The grid class sets the container to use CSS Grid layout, allowing items to be placed in rows and columns.
Fix the error in the code by choosing the correct display class to center items horizontally in a flex container.
<div class="flex [1] items-center h-32 bg-blue-100"> <p>Centered content</p> </div>
The class justify-center centers flex items horizontally inside the container.
Fill both blanks to create a responsive grid with 3 columns on medium screens and gap between items.
<div class="[1] [2] gap-6 p-4"> <div class="bg-green-200 p-2">Box 1</div> <div class="bg-green-200 p-2">Box 2</div> <div class="bg-green-200 p-2">Box 3</div> </div>
The grid class sets the container to grid layout. The md:grid-cols-3 class creates 3 columns on medium screens and larger.
Fill all three blanks to create a flex container that stacks items vertically on small screens and horizontally on large screens with spacing.
<div class="flex [1] [2] [3] gap-4 p-4"> <div class="bg-yellow-200 p-2">Item A</div> <div class="bg-yellow-200 p-2">Item B</div> </div>
flex-col stacks items vertically by default. lg:flex-row changes layout to horizontal on large screens. items-center centers items vertically in the flex container.