Challenge - 5 Problems
Line Height Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Understanding Tailwind's line-height utility
Which Tailwind class sets the line height to 1.5 times the font size?
Attempts:
2 left
💡 Hint
Tailwind's default font size is 1rem and leading-6 sets line height to 1.5rem, which equals 1.5 times the font size.
✗ Incorrect
The leading-6 class in Tailwind sets the line height to 1.5rem, which is 1.5 times the default font size of 1rem.
📝 Syntax
intermediate2:00remaining
Correct Tailwind class for tight line height
Which Tailwind class applies a line height of 1.25 (tight leading)?
Attempts:
2 left
💡 Hint
The class name suggests a 'tight' line height.
✗ Incorrect
leading-tight sets the line height to 1.25, which is tighter than normal.
❓ rendering
advanced3:00remaining
Visual difference of line height classes
Given the HTML below, which option shows the correct visual difference between
leading-relaxed and leading-snug?Tailwind
<p class="leading-relaxed">This text has relaxed line height.</p> <p class="leading-snug">This text has snug line height.</p>
Attempts:
2 left
💡 Hint
Relaxed means more space, snug means less space.
✗ Incorrect
leading-relaxed increases line height to about 1.625, making lines more spaced out. leading-snug sets line height to about 1.375, which is tighter.
❓ selector
advanced2:30remaining
Choosing the right Tailwind class for accessibility
Which Tailwind line height class is best for improving readability for users with visual impairments?
Attempts:
2 left
💡 Hint
More line spacing helps readability.
✗ Incorrect
leading-relaxed increases line height, making text easier to read for many users, especially those with visual impairments.
🧠 Conceptual
expert3:00remaining
Effect of custom line height with arbitrary values
What will be the computed line height if you use the Tailwind class
leading-[2.2] on a paragraph with font size 1rem?Attempts:
2 left
💡 Hint
Arbitrary values in Tailwind allow precise control.
✗ Incorrect
The class leading-[2.2] sets the line height to exactly 2.2 times the font size, so with 1rem font size, line height is 2.2rem.