Which of the following is a valid CSS math function?
A
add() B
calc() C
math() D
compute()
Analysis & Theory
`calc()` is a valid CSS math function used to perform calculations with length units.
What is the correct syntax for using `calc()` to set a width that's 100% minus 50px?
A
width: calc(100% - 50px); B
width: calc(100% + 50px); C
width: calc(100 - 50px); D
width: calc(100% * 50px);
Analysis & Theory
`calc(100% - 50px)` is the proper syntax to subtract values in CSS.
Which of these is NOT a valid operator in the `calc()` function?
A
+ B
- C
* D
%
Analysis & Theory
`%` is not a valid operator inside `calc()`. Valid operators are `+`, `-`, `*`, and `/`.
What is the purpose of the `min()` CSS function?
A
It returns the highest value B
It limits a value to a minimum C
It returns the smallest of given values D
It rounds a number down
Analysis & Theory
`min()` returns the smallest value among its arguments.
Which function returns the largest of multiple CSS values?
A
calc() B
min() C
max() D
clamp()
Analysis & Theory
`max()` returns the largest value from the given list.
What does `clamp(1rem, 5vw, 3rem)` do?
A
Fixes the value at 5vw only B
Returns a fixed 1rem C
Sets a responsive value between 1rem and 3rem D
Adds 1rem and 3rem
Analysis & Theory
`clamp(min, preferred, max)` restricts the value between a min and max, scaling responsively.
Which of the following is true about `calc()`?
A
It only supports percentage units B
It cannot mix unit types C
It allows combining units like px, %, rem, etc. D
It only works with integers
Analysis & Theory
`calc()` allows combining different units such as `px`, `%`, `em`, `rem` etc.
Which CSS math function would you use to set a font size that adjusts but stays within a limit?
A
calc() B
min() C
max() D
clamp()
Analysis & Theory
`clamp()` is perfect for setting a responsive font size within defined limits.
What is the output of `min(50vw, 300px)` if the viewport is 800px wide?
A
300px B
400px C
50vw D
100vw
Analysis & Theory
50vw of 800px is 400px, so `min(400px, 300px)` returns 300px.
Which of the following math functions helps maintain fluid typography?
A
calc() B
clamp() C
min() D
max()
Analysis & Theory
`clamp()` is ideal for fluid typography, scaling text size between a min and max value.