← Quiz: CSS Basics: all 10 questions
Quiz: CSS Basics · Question 9 of 10
What does margin: 12px auto; do to a block element with a fixed width?
What does margin: 12px auto; do to a block element with a fixed width?
- A.Adds 12px padding inside it
- B.Adds 12px top and bottom margin and centres it horizontally
- C.Makes it full width
- D.Hides it
Answer & explanation
Correct answer: Adds 12px top and bottom margin and centres it horizontally
Automatic left and right margins share the free space equally.
Can you get the rest right without peeking?
Take the timed Quiz: CSS Basics quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →