Complete the code to create a container with Tailwind CSS that uses Flexbox.
<div class="[1]"> Content </div>
The flex class in Tailwind applies display: flex; which is essential for the Holy Grail layout.
Complete the code to make the left sidebar fixed width and the main content flexible.
<div class="flex"> <aside class="w-[1] bg-gray-200">Sidebar</aside> <main class="flex-1 bg-white">Main content</main> </div>
The class w-64 sets a fixed width of 16rem (64 * 0.25rem) for the sidebar.
Fix the error in the code to make the footer stick to the bottom using Tailwind.
<div class="flex flex-col min-h-screen"> <header class="bg-blue-500 p-4">Header</header> <main class="flex-grow p-4">Content</main> <footer class="[1] bg-gray-800 text-white p-4">Footer</footer> </div>
In a flex column layout with min-h-screen, using flex-grow on the main content pushes the footer to the bottom naturally. Using static (default) on the footer keeps it in flow and at the bottom. Using sticky or fixed removes it from flow and causes layout issues.
Fill both blanks to create a three-column Holy Grail layout with fixed sidebars and flexible center.
<div class="flex min-h-screen"> <aside class="w-[1] bg-gray-300">Left Sidebar</aside> <main class="flex-[2] bg-white">Main Content</main> <aside class="w-[1] bg-gray-300">Right Sidebar</aside> </div>
flex-2 which is not standard Tailwind flex-grow.The sidebars have fixed width w-64 and the main content uses flex-1 to fill remaining space.
Fill all three blanks to add header, main layout, and footer with proper Tailwind classes for Holy Grail layout.
<div class="flex flex-col min-h-screen"> <header class="bg-blue-600 text-white p-4 [1]">Header</header> <div class="flex flex-[2]"> <aside class="w-[3] bg-gray-200">Sidebar</aside> <main class="flex-1 p-4">Content</main> </div> <footer class="bg-gray-800 text-white p-4">Footer</footer> </div>
The header uses sticky top-0 to stay visible on top, the middle container flexes with flex-1, and the sidebar has fixed width w-64.