20 CSS MCQs To Test Intermediate Key Concepts
1. Which CSS property is used to change the spacing between letters in a text?
- text-align
- letter-spacing
- line-height
- word-spacing
2. What does the acronym “CSS” stand for?
- Computer Style Sheets
- Creative Styling System
- Cascading Style Sheets
- Custom Styling Syntax
3. Which CSS selector targets an element with the class “highlight”?
- #highlight
- .highlight
- highlight
- highlight
4. The “box-model” in CSS consists of which four elements?
- Margin, Border, Padding, Content
- Border, Padding, Margin, Content
- Padding, Content, Border, Margin
- Content, Margin, Padding, Border
5. What CSS property is used to create rounded corners for an element?
- border-style
- border-radius
- corner-radius
- border-corner
6. Which CSS value is commonly used to horizontally center an element?
- center
- margin-auto
- horizontal-align
- text-center
7. Which property allows you to change the transparency of an element in CSS?
- opacity
- transparent
- visibility
- display
8. The “float” property in CSS is used primarily for:
- Changing font styles
- Creating animation effects
- Positioning elements horizontally
- Applying gradient backgrounds
9. Which CSS pseudo-class targets a link when a user hovers over it?
- :hover
- :active
- :link
- :visited
10. What is the purpose of the “z-index” property in CSS?
- Changing the text color
- Adjusting the vertical alignment
- Controlling the stacking order of elements
- Modifying the element’s width
11. In CSS, which property is used to change the background color of an element?
- background-color
- color-background
- element-color
- bg-color
12. What does “CSS specificity” refer to?
- The speed at which CSS styles are applied
- The order in which CSS rules are written in the stylesheet
- The process of selecting the appropriate font for a webpage
- The hierarchy of rules that determines which styles are applied to an element
13. Which CSS unit is relative to the font size of the parent element?
- px (pixels)
- em
- rem
- vw (viewport width)
14. Which property is used to align text within its containing element?
- text-align
- align-text
- text-style
- text-position
15. What is the purpose of the “display” property in CSS?
- Changing the font family of text
- Adjusting the spacing between lines of text
- Controlling how an element is rendered in the layout
- Adding a border around an element
16. Which CSS property is used to control the spacing between lines of text?
- line-spacing
- text-spacing
- line-height
- letter-spacing
17. What does the CSS property “position: absolute;” do?
- Positions an element relative to its normal position
- Centers an element horizontally on the page
- Removes an element from the document flow
- Sets the element’s background image
18. Which value of the “position” property in CSS keeps an element in its normal position within the document flow?
- relative
- fixed
- absolute
- static
19. Which property is used to change the style of the border between different elements?
- element-border
- border-style
- outline
- separator
20. What is the purpose of the CSS property “box-shadow”?
- To add a shadow to the background of an element
- To change the color of the element’s border
- To adjust the spacing between elements
- To create a shadow effect around an element
Enjoy answering these questions and testing your knowledge!