CSS Fundamentals Quiz — Questions & Answers

This quiz contains 10 questions. Below is a complete reference of all questions, answer choices, and correct answers. You can use this section to review after taking the interactive quiz above.

  1. Question 1: CSS Specificity

    Which CSS selector has the highest specificity?

    • An element selector
    • A class selector
    • An ID selector
    • An attribute selector
    • A tag selector
    Show correct answer

    Correct answer: An ID selector

  2. Question 2: CSS Box Model

    What property controls the space between the element's content and its border?

    • Margin
    • Border
    • Padding
    • Spacing
    • Indent
    Show correct answer

    Correct answer: Padding

  3. Question 3: CSS Display Property

    Which display property makes an element generate a block element box, filling the entire width available?

    • inline
    • block
    • inline-block
    • none
    • flex
    Show correct answer

    Correct answer: block

  4. Question 4: CSS Positioning

    What is the default value of the 'position' property in CSS?

    • relative
    • absolute
    • fixed
    • static
    • sticky
    Show correct answer

    Correct answer: static

  5. Question 5: CSS Selectors

    Which selector is used to select all elements of a specific type?

    • .element
    • #element
    • element
    • *
    • [element]
    Show correct answer

    Correct answer: element

  6. Question 6: CSS Cascading

    In CSS, what determines which styles are applied when multiple rules conflict?

    • The order they are defined in the HTML
    • The file size of the CSS document
    • The specificity of the selectors
    • The number of properties in the rule
    • The rule declared first
    Show correct answer

    Correct answer: The specificity of the selectors

  7. Question 7: CSS Font Property

    Which CSS property is used to control the boldness of text?

    • text-weight
    • font-style
    • font-size
    • font-weight
    • line-height
    Show correct answer

    Correct answer: font-weight

  8. Question 8: CSS Colors

    Which of the following is a valid way to define a color in CSS?

    • color: #00FF00;
    • color: green;
    • color: rgb(0, 255, 0);
    • All of the above
    • None of the above
    Show correct answer

    Correct answer: All of the above

  9. Question 9: CSS Units

    Which CSS unit is relative to the font size of the root element?

    • em
    • rem
    • vh
    • vw
    • px
    Show correct answer

    Correct answer: rem

  10. Question 10: CSS Inheritance

    What happens to CSS properties that are not inherited by default?

    • They are ignored
    • They are inherited from the parent element
    • They use the browser's default value
    • They use a predefined 'auto' value
    • They cause an error
    Show correct answer

    Correct answer: They use the browser's default value