2. Which HTML attribute is used to define inline styles?
styles
style
class
font
3. Which CSS property is used to change the text color of an element?
color
text-color
foreground-color
font-color
4. How do you insert a comment in a CSS file?
/* this is a comment */
// this is a comment
' this is a comment
<!-- this is a comment -->
5. Which CSS property is used to control the element's font size?
font-size
text-size
font-style
text-style
6. What is the CSS selector to select all <p> elements on a page?
.p
#p
p
<p>
7. How do you group selectors in CSS?
By separating them with a comma
By separating them with a space
By separating them with a plus sign
By separating them with a dot
8. Which CSS property controls the text decoration?
text-style
text-decoration
font-decoration
style-text
9. How do you make each word in a text start with a capital letter using CSS?
text-transform:capitalize
text-style:capitalize
transform:capitalize
text-case:capitalize
10. Which property is used to set the background color of an element?
background-color
color-background
bg-color
element-background
11. What is the correct CSS syntax to make all the <p> elements bold?
p {font-weight:bold;}
<p style="font-weight:bold;">
p-style {font-weight:bold;}
text-bold:p
12. Which CSS property is used to change the left margin of an element?
margin-left
indent-left
left-margin
margin-side
13. How do you select an element with the ID "demo" in CSS?
.demo
demo
#demo
*demo
14. How do you select elements with class name "test" in CSS?
test
#test
.test
*test
15. What property is used to change the font of an element?
font-family
font-style
font-weight
font-variant
16. Which CSS property is used to set the spacing between lines of text?
line-height
spacing
text-spacing
line-spacing
17. How do you make a list that lists its items with squares?
list-type: square
type: square
list-style-type: square
list-decoration: square
18. Which value of the "display" property removes the element from the normal flow of the document and no space is created for the element in the page layout?
visibility: hidden
display: none
display: hidden
visible: false
19. Which CSS property is used to make text italic?
font-style: italic
text-style: italic
style: italic
font: italic
20. What is the default value of the "position" property?
fixed
relative
absolute
static
21. Which CSS property is used for controlling the layout of multiple boxes in a row?
float
align
layout
position
22. What is the purpose of the "z-index" property in CSS?
To set the zoom level of an element
To specify the stacking order of an element
To define the index of an element in an array
To control the indentation of text
23. Which CSS unit is relative to the font-size of the element?
px
cm
em
%
24. What does CSS specificity determine?
Which style rule is more specific than others
The loading speed of the CSS file
The browser compatibility of CSS rules
How CSS animations are rendered
25. Which CSS pseudo-class is used to define the style of a link when it is being hovered over?