Challenge - 5 Problems
Height Utilities Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ selector
intermediate1:30remaining
Which Tailwind class sets an element's height to 6rem?
Choose the Tailwind CSS class that sets the height of an element to exactly 6rem.
Attempts:
2 left
💡 Hint
Tailwind's height scale uses multiples of 0.25rem. For example, h-4 is 1rem.
✗ Incorrect
In Tailwind CSS, h-24 sets height to 6rem because 24 * 0.25rem = 6rem.
Other options correspond to different rem values.
❓ rendering
intermediate1:30remaining
What is the visible height of a div with class
h-screen?If a div has the Tailwind class
h-screen, what height will it have relative to the browser window?Tailwind
<div class="h-screen bg-blue-300">Content</div>Attempts:
2 left
💡 Hint
Think about what 'screen' means in Tailwind height utilities.
✗ Incorrect
The h-screen class sets the element's height to 100vh, which means 100% of the viewport height.
🧠 Conceptual
advanced1:30remaining
Which Tailwind class sets height to 50% of the parent element?
Select the Tailwind CSS class that sets an element's height to exactly half of its parent container's height.
Attempts:
2 left
💡 Hint
Tailwind uses fraction classes like h-1/2 for percentage heights.
✗ Incorrect
The class h-1/2 sets height to 50% of the parent element.
Other fractions represent different percentages.
❓ accessibility
advanced2:00remaining
Why should you avoid fixed height classes like
h-64 for content containers?Choose the best reason why using fixed height utilities like
h-64 on content containers can cause accessibility issues.Attempts:
2 left
💡 Hint
Think about what happens if content is taller than a fixed height container.
✗ Incorrect
Using fixed heights can cause content to overflow and be hidden, which is bad for users relying on keyboard navigation or screen readers.
Flexible heights or min-height are better for accessibility.
📝 Syntax
expert2:00remaining
What error occurs if you write
h-1/2 as h-1\/2 in Tailwind config?If you mistakenly escape the slash in a Tailwind height class like
h-1\/2 in your HTML, what will happen when the page renders?Tailwind
<div class="h-1\/2 bg-red-200">Test</div>Attempts:
2 left
💡 Hint
Tailwind class names must match exactly; escaping slashes is not needed in HTML class attributes.
✗ Incorrect
Escaping the slash breaks the class name, so Tailwind does not recognize it and does not apply the height.
The element falls back to default height.