CSS Quiz

Test your knowledge of CSS with our CSS Quiz, the test currently contains 20 questions. You will get 1 point for each correct answer. At the end of the Quiz, your total score will be displayed. Maximum score is 20 points. If you don't get the full score, you'll have an option to try again.

If this site has been useful, we’d love your support! Running this site takes time and resources, and every small contribution helps us keep creating valuable content. Consider buying us a coffee to keep things going strong!

CSS Quiz

Question:



Quiz Answers

Question 1: What is the correct CSS syntax for making all the <span> elements bold?
Answers: span {font-weight: bold}

Question 2: How do you add a comment in a CSS file?
Answers: /* this is a comment */

Question 3: What property is used to change the text color of an element?
Answers: color:

Question 4: What does CSS stand for?
Answers: Cascading Style Sheets

Question 5: The # symbol specifies that the selector is?
Answers: id

Question 6: Which is the correct CSS syntax?
Answers: p {color: black;}

Question 7: Which of the following would be used to create an ID called header which has a width of 750px, a height of 30px and the color of the text is black?
Answers: #header { height: 30px; width: 750px; color: black; }

Question 8: Which snippet of CSS is commonly used to center a website horizontally?
Answers: margin: 0 auto;

Question 9: How do you make a list not display bullet points?
Answers: list-style-type: none

Question 10: What is the correct CSS syntax to change the font name?
Answers: font-family:

Question 11: What is the correct Syntax for importing a stylesheet in CSS?
Answers: @import url(css/example.css);

Question 12: Which HTML attribute is used to define inline CSS styles?
Answers: Style

Question 13: How do you make each word in a text start with a capital letter?
Answers: text-transform: capitalize

Question 14: What is the correct CSS syntax for making all the <p> tag's font size 14px?
Answers: p {font-size: 14px;}

Question 15: A declaration is terminated by?
Answers: ; - semi colon

Question 16: Which CSS property controls the text size?
Answers: font-size

Question 17: How do you insert padding so that it is:
10 pixels at the top
15 pixels at the bottom
5 pixels at the right
10 pixels to the left?
Answers: padding: 10px 5px 15px 10px;

Question 18: Which property is used to change the background color?
Answers: background-color:

Question 19: How do you display hyperlinks without an underline?
Answers: a {text-decoration: none}

Question 20: How to rotate objects using CSS3?
Answers: transform: rotate(30deg);