Challenge - 5 Problems
Responsive Typography Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Understanding viewport units in responsive typography
Which CSS unit is best suited for scaling font size based on the viewport width?
Attempts:
2 left
💡 Hint
Think about a unit that changes size as the browser window changes width.
✗ Incorrect
The vw unit stands for viewport width and scales the font size relative to the width of the browser window, making it ideal for responsive typography.
📝 Syntax
intermediate2:00remaining
Correct syntax for fluid typography using clamp()
Which CSS snippet correctly uses
clamp() to create fluid typography that scales between 1rem and 3rem based on viewport width?Attempts:
2 left
💡 Hint
Remember the order is min, preferred, max.
✗ Incorrect
The clamp() function takes three values: minimum, preferred, and maximum. Option C correctly sets the font size to never go below 1rem, scale with 2vw, and never exceed 3rem.
❓ rendering
advanced2:00remaining
Result of CSS with clamp() on different viewport widths
Given this CSS, what will be the font size when the viewport width is 500px?
Note: 1rem = 16px.
font-size: clamp(1rem, 5vw, 2rem);Note: 1rem = 16px.
Attempts:
2 left
💡 Hint
Calculate 5vw at 500px width and compare with min and max.
✗ Incorrect
5vw means 5% of viewport width. 5% of 500px is 25px. The clamp sets minimum 16px, preferred 25px, maximum 32px (2rem). So the font size is 25px.
❓ selector
advanced2:00remaining
CSS selector for responsive typography on headings only
Which CSS selector targets all heading elements (h1 to h6) to apply responsive font sizes?
Attempts:
2 left
💡 Hint
Think about how to list multiple selectors in CSS.
✗ Incorrect
Option D correctly lists all heading tags separated by commas. Options B, C, and D are invalid selectors.
❓ accessibility
expert2:00remaining
Ensuring accessible responsive typography
Which practice best improves accessibility when using responsive typography?
Attempts:
2 left
💡 Hint
Accessibility means users can adjust text size easily.
✗ Incorrect
Using relative units like rem respects user settings and allows zooming, improving readability and accessibility. Fixed pixels and disabling zoom harm accessibility.