20 CSS MCQs To Test Intermediate Key Concepts

20 CSS MCQs To Test Intermediate Key Concepts

1. Which CSS property is used to change the spacing between letters in a text?

  1. text-align
  2. letter-spacing
  3. line-height
  4. word-spacing

2. What does the acronym “CSS” stand for?

  1. Computer Style Sheets
  2. Creative Styling System
  3. Cascading Style Sheets
  4. Custom Styling Syntax

3. Which CSS selector targets an element with the class “highlight”?

  1. #highlight
  2. .highlight
  3. highlight
  4. highlight

4. The “box-model” in CSS consists of which four elements?

  1. Margin, Border, Padding, Content
  2. Border, Padding, Margin, Content
  3. Padding, Content, Border, Margin
  4. Content, Margin, Padding, Border

5. What CSS property is used to create rounded corners for an element?

  1. border-style
  2. border-radius
  3. corner-radius
  4. border-corner

6. Which CSS value is commonly used to horizontally center an element?

  1. center
  2. margin-auto
  3. horizontal-align
  4. text-center

7. Which property allows you to change the transparency of an element in CSS?

  1. opacity
  2. transparent
  3. visibility
  4. display

8. The “float” property in CSS is used primarily for:

  1. Changing font styles
  2. Creating animation effects
  3. Positioning elements horizontally
  4. Applying gradient backgrounds

9. Which CSS pseudo-class targets a link when a user hovers over it?

  1. :hover
  2. :active
  3. :link
  4. :visited

10. What is the purpose of the “z-index” property in CSS?

  1. Changing the text color
  2. Adjusting the vertical alignment
  3. Controlling the stacking order of elements
  4. Modifying the element’s width

11. In CSS, which property is used to change the background color of an element?

  1. background-color
  2. color-background
  3. element-color
  4. bg-color

12. What does “CSS specificity” refer to?

  1. The speed at which CSS styles are applied
  2. The order in which CSS rules are written in the stylesheet
  3. The process of selecting the appropriate font for a webpage
  4. 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?

  1. px (pixels)
  2. em
  3. rem
  4. vw (viewport width)

14. Which property is used to align text within its containing element?

  1. text-align
  2. align-text
  3. text-style
  4. text-position

15. What is the purpose of the “display” property in CSS?

  1. Changing the font family of text
  2. Adjusting the spacing between lines of text
  3. Controlling how an element is rendered in the layout
  4. Adding a border around an element

16. Which CSS property is used to control the spacing between lines of text?

  1. line-spacing
  2. text-spacing
  3. line-height
  4. letter-spacing

17. What does the CSS property “position: absolute;” do?

  1. Positions an element relative to its normal position
  2. Centers an element horizontally on the page
  3. Removes an element from the document flow
  4. 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?

  1. relative
  2. fixed
  3. absolute
  4. static

19. Which property is used to change the style of the border between different elements?

  1. element-border
  2. border-style
  3. outline
  4. separator

20. What is the purpose of the CSS property “box-shadow”?

  1. To add a shadow to the background of an element
  2. To change the color of the element’s border
  3. To adjust the spacing between elements
  4. To create a shadow effect around an element

Enjoy answering these questions and testing your knowledge!

Leave a comment