CSS QUIZ 25 Test your Knowledge!
Questions for CSS Quiz
What does CSS stand for?
A. Computer Style Sheets
B. Creative Style Sheets
C. Cascading Style Sheets
D. Colorful Style Sheets
Which CSS property controls the text size?
A. font-style
B. text-size
C. font-size
D. text-style
How do you make each word in a text start with a capital letter?
A. text-transform:capitalize
B. text-transform:uppercase
C. text-style:capitalize
D. font-style:capitalize
Which property is used to change the background color?
A. bgcolor
B. color
C. background-color
D. background
How do you add a background image to an element?
A. background:url(image.png)
B. background-image:url(‘image.png’)
C. background-color:url(“image.png”)
D. color:url(“image.png”)
Which property is used to change the font of an element?
A. font-style
B. font-family
C. font-weight
D. font-type
How do you select an element with the id “demo”?
A. #demo
B. .demo
C. demo
D. *demo
Which property is used to change the left margin of an element?
A. margin-left
B. padding-left
C. indent
D. align-left
How do you select elements with the class name “test”?
A. #test
B. .test
C. test
D. *test
How do you select all p elements inside a div element?
A. div + p
B. div p
C. div.p
D. p > div
Which property changes the color of text?
A. text-color
B. color
C. font-color
D. background-color
Which CSS property controls the text alignment?
A. text-align
B. align
C. text
D. font-align
What does the “display: none;” property do?
A. Hides an element
B. Removes an element and its space
C. Decreases the opacity of an element
D. Both A and B
How do you make a list that lists its items with squares?
A. list-style-type: square;
B. list-type: square;
C. list: square;
D. list-style: square;
How do you display hyperlinks without an underline?
A. a {text-decoration:no-underline;}
B. a {text-decoration:none;}
C. a {underline:none;}
D. a {decoration:no-underline;}
Which property is used to change the font color of an element?
A. text-color
B. fgcolor
C. color
D. font-color
Which of the following is used to set the spacing between lines?
A. line-spacing
B. line-height
C. spacing
D. line-space
What does z-index do?
A. Changes the opacity of an element
B. Arranges elements in a stack
C. Aligns elements horizontally
D. Controls the zoom level of an element
How do you make a list that lists its items with numbers?
A. list-style-type: numbers;
B. list-type: number;
C. list: number;
D. list-style-type: decimal;
How do you select all the p elements on a page?
A. #p
B. .p
C. p
D. all.p
What is the default value of the position property?
A. relative
B. fixed
C. absolute
D. static
How can you created rounded corners using CSS?
A. corner-radius: 2px;
B. border-radius: 2px;
C. radius: 2px;
D. border-corner: 2px;
Which property is used to set the background color of an element?
A. color
B. background-color
C. bgcolor
D. background
Which CSS property is used to control the layout of multiple columns?
A. column-count
B. columns
C. column-layout
D. column-control
How do you make the text bold in CSS?
A. font-weight:bold;
B. style:bold;
C. font:bold;
D. text:bold;
Correct Answers Table
Question Number | Correct Answer |
1 | C |
2 | C |
3 | A |
4 | C |
5 | B |
6 | B |
7 | A |
8 | A |
9 | B |
10 | B |
11 | B |
12 | A |
13 | B |
14 | A |
15 | B |
16 | C |
17 | B |
18 | B |
19 | D |
20 | C |
21 | D |
22 | B |
23 | B |
24 | A |
25 | A |
Explanations for the Correct Answers
C: CSS stands for Cascading Style Sheets, used for styling HTML elements.
C: font-size controls the size of the text in a CSS style.
A: text-transform: capitalize capitalizes the first letter of each word in the text.
C: background-color sets the background color of an element.
B: background-image:url(‘image.png’) adds a background image to an element.
B: font-family changes the font of an element.
A: #demo is used to select an element with the id “demo.”
A: margin-left sets the left margin of an element.
B: .test selects elements with the class name “test.”
B: div p selects all p elements inside div elements.
B: The color property is used to change the text color.
A: text-align property controls text alignment.
B: display: none; both hides an element and removes it from the document layout.
A: list-style-type: square; is used for square bullets in lists.
B: a {text-decoration:none;} removes the underline from links.
C: color is used to change the font color.
B: line-height sets the space between lines.
B: z-index controls the stack order of elements that overlap.
D: list-style-type: decimal; creates a numbered list.
C: p selects all p elements.
D: The default position value is static.
B: border-radius creates rounded corners.
B: background-color sets the background color of an element.
A: column-count controls the number of columns in a multi-column layout.
A: font-weight:bold; makes the text bold.