Complete the code to set the width to 100 pixels minus 20 pixels using calc().
width: calc(100px [1] 20px);
The calc() function allows you to perform calculations to set CSS property values. Here, subtracting 20px from 100px uses the minus sign -.
Complete the code to set the height to half of the viewport height using calc().
height: calc(100vh [1] 2);
To get half the viewport height, divide 100vh by 2 using the division operator / inside calc().
Fix the error in the code to correctly calculate width as 50% minus 10 pixels.
width: calc(50% [1] 10px);
The correct operator to subtract 10 pixels from 50% is the minus sign -. Using other operators causes wrong results or errors.
Fill both blanks to set margin to 10 pixels plus 5% using calc().
margin: calc([1] [2] 5%);
The margin is calculated by adding 10 pixels and 5%. So the first blank is 10px and the operator is +.
Fill all three blanks to create a padding that is 5 pixels plus 2 times 3 pixels using calc().
padding: calc([1] [2] [3]);
The padding is calculated as 5 pixels plus 2 times 3 pixels. So the first blank is 5px, the operator is +, and the last part is 2 * 3px.