CSS Spacing Quiz

Quiz 5 9 questions

Prerequisites for the quiz

  1. CSS Spacing Unit

Are you ready?

9 questions to solve

  1. This quiz goes to full-screen once you press the Start button.
  2. At the end of the quiz, you are able to review all the questions that you answered wrong and see their explanations.
In the following result which section represents the margins of an element p whose borders are given by the dotted lines.
Section A
Section B
Refer to CSS Margins for more info.
How can we give an element p a top margin of 20px?
Both choices (A) and (B) can give a top margin of 20px to the p element. Hence (D) is the right answer.
Which margins does the rule margin: 20px 10px 5px 10px represent?
Refer to the last section of CSS Margins for more info.
The margin property can take one, two, three or four parameters. True or false?
Refer to the last section of CSS Margins for more info.
Which of the following two elements seems to have 30px of padding?
Element 1
Element 2
Element 2 right away seems to have a larger value of padding as comapared to element 1 and hence is the right choice.
padding: 20px 10px goes with which of the following choices?
Refer to CSS Padding for more info.
Using padding how can you give a 10px top, 15px right, 5px bottom and 15px left padding, using the least number of parameters?
Choice (D) does assign the correct number of padding to each side but doesn't use the least number of parameters (it uses 4 params). This is fulfilled by choice (B) with 3 params only.
Suppose an element #capt has a padding: 10px 30px rule set on it. How can we modify only its left padding to 50px, without having to restate each side's padding?
We only need to change the left padding so we use the property padding-left. Hence the choice (C).
padding can be specified in units of %. True or false? If true, then to what is its value relative to?
Refer to CSS Padding for more info.

"I created Codeguage to save you from falling into the same learning conundrums that I fell into."

— Bilal Adnan, Founder of Codeguage