🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: CSS Basics: questions with answers

10 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. Which selector targets all elements with class="btn"?
  2. Q2. Which space is INSIDE the border?
  3. Q3. Two rules: .title { color: red } and main { color: blue } both match an element. Which colour wins?
  4. Q4. What does box-sizing: border-box do?
  5. Q5. Which unit is relative to the root font size?
  6. Q6. Which way of adding CSS is best for a real website?
  7. Q7. Which selector matches only <li elements that are direct children of a <ul?
  8. Q8. Why is rem preferred over px for font sizes?
  9. Q9. What does margin: 12px auto; do to a block element with a fixed width?
  10. Q10. Two rules have the same specificity and both set color. Which one wins?