Recall & Review
beginner
What does a sticky header do on a webpage?
A sticky header stays fixed at the top of the page when you scroll down, so it is always visible.
Click to reveal answer
beginner
Which Tailwind CSS class makes an element sticky?The <code>sticky</code> class makes an element sticky. You also need to set a position like <code>top-0</code> to fix it at the top.Click to reveal answer
beginner
How do you make a footer stick to the bottom of the viewport using Tailwind CSS?
Use
sticky bottom-0 classes on the footer element. This keeps the footer visible at the bottom when scrolling.Click to reveal answer
intermediate
Why is it important to use semantic HTML elements like
<header> and <footer> with sticky positioning?Semantic elements improve accessibility and help screen readers understand the page structure. Sticky positioning keeps these important sections visible.
Click to reveal answer
intermediate
What Tailwind utility classes help ensure a sticky header does not cover page content?
Use padding or margin on the main content equal to the header height, for example
pt-16 if the header is 4rem tall, so content is not hidden behind the sticky header.Click to reveal answer
Which Tailwind classes make a header sticky at the top?
✗ Incorrect
The
sticky class with top-0 fixes the header at the top while allowing normal flow until scrolling.What does the
bottom-0 class do when combined with sticky?✗ Incorrect
bottom-0 sets the sticky element to stick at the bottom edge of the viewport.Why add padding-top to the main content when using a sticky header?
✗ Incorrect
Padding-top equal to the header height pushes content down so it is not hidden behind the sticky header.
Which HTML element is best for a sticky footer?
✗ Incorrect
The
What is a benefit of using sticky headers and footers?
✗ Incorrect
Sticky headers and footers keep key navigation or info visible, improving user experience.
Explain how to create a sticky header and footer using Tailwind CSS. Include which classes to use and why padding or margin might be needed.
Think about how sticky positioning works and how to keep content visible.
You got /4 concepts.
Describe why semantic HTML and accessibility matter when building sticky headers and footers.
Consider users who rely on assistive technology.
You got /4 concepts.