CSS Basics Quiz

Test your knowledge of CSS fundamentals

1. What does CSS stand for?
Correct Answer: Cascading Style Sheets
Explanation: CSS is used to style and layout web pages.
2. Which property is used to change text color?
Correct Answer: color
Explanation: The CSS property "color" changes the text color.
3. How do you make the text bold in CSS?
Correct Answer: font-weight: bold;
Explanation: The "font-weight" property controls the boldness of text.
4. Which property is used to change the background color?
Correct Answer: background-color
Explanation: The "background-color" property sets the background color of an element.
5. How do you select an element with id "header"?
Correct Answer: #header
Explanation: The "#" symbol is used to select an element by its ID.
6. Which property is used to change the font size?
Correct Answer: font-size
Explanation: The "font-size" property sets the size of the text.
7. How do you create a bulleted list?
Correct Answer: list-style: disc;
Explanation: "list-style: disc;" creates a bulleted list in CSS.
8. How do you center text in CSS?
Correct Answer: text-align: center;
Explanation: The "text-align" property centers the text horizontally.
9. Which property is used to add space inside an element?
Correct Answer: padding
Explanation: The "padding" property adds space inside an element's border.
10. Which property is used to change the width of a border?
Correct Answer: border-width
Explanation: "border-width" sets the thickness of a border in CSS.