0
0
CSSmarkup~10 mins

Min and max functions in CSS - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the width to the minimum of 300px or 50% of the viewport width.

CSS
width: [1](300px, 50vw);
Drag options to blanks, or click blank then click option'
Amin
Bcalc
Cclamp
Dmax
Attempts:
3 left
💡 Hint
Common Mistakes
Using max() instead of min() will pick the larger value.
Using calc() or clamp() here won't directly pick the minimum.
2fill in blank
medium

Complete the code to set the font size to the maximum of 16px or 2vw.

CSS
font-size: [1](16px, 2vw);
Drag options to blanks, or click blank then click option'
Amax
Bmin
Ccalc
Dclamp
Attempts:
3 left
💡 Hint
Common Mistakes
Using min() will pick the smaller value, which might make text too small.
Using clamp() or calc() won't directly pick the maximum.
3fill in blank
hard

Fix the error in the code to correctly limit the height between 100px and 50vh.

CSS
height: [1](100px, 50vh);
Drag options to blanks, or click blank then click option'
Amax
Bmin
Cheight
Dwidth
Attempts:
3 left
💡 Hint
Common Mistakes
Using max() will pick the larger value, which can exceed limits.
Using height or width as a function name is invalid.
4fill in blank
hard

Fill both blanks to set padding to the minimum of 20px or 5vw and margin to the maximum of 10px or 2vw.

CSS
padding: [1](20px, 5vw);
margin: [2](10px, 2vw);
Drag options to blanks, or click blank then click option'
Amin
Bmax
Ccalc
Dclamp
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping min and max functions.
Using calc() or clamp() instead of min/max.
5fill in blank
hard

Fill all three blanks to set width to clamp between 200px and 80vw with a preferred size of 50vw.

CSS
width: [1]([2], 50vw, [3]);
Drag options to blanks, or click blank then click option'
Amin
Bclamp
C80vw
D200px
Attempts:
3 left
💡 Hint
Common Mistakes
Using min() or max() instead of clamp().
Swapping min and max values.