Complete the code to make the header sticky at the top of the page.
<header class="bg-blue-600 text-white p-4 [1]"> <h1 class="text-xl font-bold">My Website</h1> </header>
Using sticky top-0 makes the header stick to the top when scrolling.
Complete the code to make the footer sticky at the bottom of the page.
<footer class="bg-gray-800 text-white p-4 [1]"> <p>Ā© 2024 My Website</p> </footer>
The sticky bottom-0 classes keep the footer visible at the bottom when scrolling.
Fix the error in the main content area to avoid it being hidden behind the sticky header.
<main class="p-4 [1]"> <p>Welcome to the main content!</p> </main>
Adding mt-16 (margin-top) pushes the main content below the sticky header to avoid overlap.
Fill both blanks to make the header and footer sticky and ensure the main content does not overlap them.
<header class="bg-blue-600 text-white p-4 [1]"> <h1 class="text-xl font-bold">My Website</h1> </header> <main class="p-4 [2]"> <p>Main content goes here.</p> </main> <footer class="bg-gray-800 text-white p-4 sticky bottom-0"> <p>Ā© 2024 My Website</p> </footer>
The header uses sticky top-0 to stick at the top, and the main content uses mt-16 to avoid overlapping the header.
Fill all three blanks to create a sticky header and footer with proper spacing in the main content.
<header class="bg-blue-600 text-white p-4 [1]"> <h1 class="text-xl font-bold">My Website</h1> </header> <main class="p-4 [2] [3]"> <p>Here is the main content area.</p> </main> <footer class="bg-gray-800 text-white p-4 sticky bottom-0"> <p>Ā© 2024 My Website</p> </footer>
The header is sticky at the top with sticky top-0. The main content has margin-top and margin-bottom (mt-16 mb-16) to avoid overlapping the header and footer.