Loading...
Sply Code
Home
Courses
Blog
Contact
About Us
Donate
Go Back
Next page
Go Back Course Outline
CSS Full Course
Quiz
CSS Quiz
1. Which of the following is the correct CSS syntax to change the background color of a page?
background-color: #ffffff;
background: #ffffff;
color: #ffffff;
2. How do you select all paragraphs in CSS?
p {}
.p {}
#p {}
3. What does the CSS property 'z-index' do?
Controls the visibility of elements
Controls the stacking order of elements
Controls the size of an element
4. Which property is used to change the font of an element?
font-family
font-style
font-size
5. Which of the following is the correct syntax to add a CSS comment?
/* This is a comment */
// This is a comment
6. How can you change the text color of an element in CSS?
text-color: red;
color: red;
font-color: red;
7. What property is used to change the width of an element?
height
width
size
8. How do you make a list horizontal in CSS?
list-style: horizontal;
list-display: inline;
display: inline;
9. Which property is used to control the space between words in CSS?
word-spacing
letter-spacing
text-align
10. What is the default value for the 'position' property in CSS?
absolute
relative
static
11. How do you apply a style to a class in CSS?
.class {}
#class {}
class {}
12. How do you hide an element in CSS?
visibility: hidden;
display: none;
Both A and B
13. What does the CSS 'float' property do?
Makes an element float left or right
Changes the position of an element
Resizes the element
14. What property is used to set the space between content and the border in CSS?
padding
margin
border-spacing
15. What CSS property controls the size of the font?
font-size
font-weight
font-family
16. How do you center a block element in CSS?
margin: auto;
text-align: center;
display: center;
17. What is the correct CSS syntax to make text bold?
font-weight: bold;
font-style: bold;
text-weight: bold;
18. How do you apply a background image to a page in CSS?
background-image: url('image.jpg');
background: url('image.jpg');
Both A and B
19. What does the 'display: flex;' property do in CSS?
It makes elements align in a column
It displays elements in a flexible box
It sets elements to display inline
20. Which CSS property is used to set the spacing between lines of text?
line-height
text-spacing
letter-spacing
21. Which property is used to change the height of an element?
height
width
size
22. How do you apply an external CSS file?
<link rel="stylesheet" href="styles.css">
<style src="styles.css"></style>
<css src="styles.css"></css>
23. What CSS property is used to specify the space around elements?
padding
margin
border
24. Which property is used to make an element invisible but still take up space?
visibility: hidden;
display: none;
opacity: 0;
25. Which CSS property allows you to create rounded corners?
border-radius
corner-radius
border-round
26. What does the 'box-shadow' property do?
Adds shadow to the text
Adds shadow to an element
Creates a glowing effect
27. How do you create a responsive layout in CSS?
Using media queries
Using flexbox
Both A and B
28. What does the 'border-collapse' property do in CSS?
Collapses the borders of adjacent table cells
Sets borders to be invisible
Adds spacing between borders
29. Which CSS property controls the visibility of an element without affecting its layout?
display
visibility
opacity
30. How can you apply a style to an ID in CSS?
.id {}
#id {}
id {}
Submit
Go Back
Next page