HTML & CSS · Middle · Question 11 of 75

What does font-size: clamp(1rem, 2.5vw, 2rem) resolve to on a 1000px-wide screen (1rem = 16px)?

Explanation

clamp(MIN, VAL, MAX) returns VAL bounded below by MIN and above by MAX. 2.5vw at 1000px = 25px, which is between 16px and 32px, so the result is 25px. At 400px it would be 10px → clamped to 16px; at 2000px → 50px → clamped to 32px. This gives fluid typography without media queries.

Further reading

Problem with a question

HTML & CSS · Middle · question 11

Test yourself

Take the HTML & CSS · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz