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