0
0
Tailwindmarkup~20 mins

Height utilities in Tailwind - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Height Utilities Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
selector
intermediate
1: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.
Ah-24
Bh-20
Ch-12
Dh-16
Attempts:
2 left
💡 Hint
Tailwind's height scale uses multiples of 0.25rem. For example, h-4 is 1rem.
rendering
intermediate
1: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>
AHeight equals 100% of the parent element's height.
BHeight is fixed at 100 pixels.
CHeight equals the full height of the viewport (browser window).
DHeight is automatically adjusted to content size.
Attempts:
2 left
💡 Hint
Think about what 'screen' means in Tailwind height utilities.
🧠 Conceptual
advanced
1: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.
Ah-3/5
Bh-1/4
Ch-2/3
Dh-1/2
Attempts:
2 left
💡 Hint
Tailwind uses fraction classes like h-1/2 for percentage heights.
accessibility
advanced
2: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.
AFixed heights can cause content to overflow and be cut off, making it inaccessible to keyboard and screen reader users.
BFixed heights improve accessibility by forcing consistent layout across devices.
CFixed heights automatically add scrollbars which are always accessible.
DFixed heights prevent color contrast issues.
Attempts:
2 left
💡 Hint
Think about what happens if content is taller than a fixed height container.
📝 Syntax
expert
2: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>
AThe element will have height 50% as intended.
BThe class will not apply, so the element will have default height (auto).
CThe browser will throw a syntax error and not render the page.
DThe element will have height 1px.
Attempts:
2 left
💡 Hint
Tailwind class names must match exactly; escaping slashes is not needed in HTML class attributes.