Recall & Review
beginner
What does the CSS
clamp() function do?It sets a value that stays between a defined minimum and maximum, adjusting smoothly between them based on the available space.
Click to reveal answer
beginner
Write the syntax of the
clamp() function.clamp(minimum, preferred, maximum) where minimum is the smallest value allowed, preferred is the ideal value, and maximum is the largest value allowed.Click to reveal answer
intermediate
Why is
clamp() useful for responsive font sizes?It lets font size grow or shrink between limits so text stays readable on small and large screens without manual media queries.
Click to reveal answer
beginner
Example:
font-size: clamp(1rem, 2vw, 3rem); What happens when the viewport is very narrow?The font size will not go below 1rem, even if 2vw is smaller, ensuring text stays readable on small screens.
Click to reveal answer
intermediate
Can
clamp() be used with units other than rem and vw?Yes, it works with any CSS length units like
px, em, vh, percentages, and more.Click to reveal answer
What is the correct order of values in
clamp()?✗ Incorrect
clamp() always uses minimum first, then preferred, then maximum.Which of these is a benefit of using
clamp() for font sizes?✗ Incorrect
clamp() helps fonts grow or shrink smoothly between set limits.If you write
clamp(10px, 5vw, 50px), what happens when 5vw is 8px?✗ Incorrect
Since 5vw (8px) is less than minimum (10px), clamp returns the minimum value.
Can
clamp() be used for properties other than font size?✗ Incorrect
clamp() works with any CSS property that accepts length values.What happens if the preferred value in
clamp() is smaller than the minimum?✗ Incorrect
Clamp ensures the value never goes below the minimum, even if preferred is smaller.
Explain how the CSS
clamp() function helps create responsive designs.Think about how it keeps values within a range depending on screen size.
You got /5 concepts.
Describe a real-life example where you would use
clamp() in CSS.Consider text on phones and big screens.
You got /5 concepts.