โ† All CSS Flashcard Decks

CSS Professional Development Flashcards

7 cards from real CSS practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 7 CSS Professional Development flashcards as text
  1. How is CSS specificity for an ID selector compared to a class selector?

    Answer: ID is higher than class

    An ID selector has higher specificity than a class selector.

  2. What does the `!important` declaration do?

    Answer: Overrides normal specificity rules

    `!important` forces a declaration to take precedence over normal cascade order.

  3. Which pseudo-class selects an element when a user hovers over it?

    Answer: :hover

    `:hover` styles an element while the pointer is over it.

  4. What does the universal selector `*` target?

    Answer: All elements

    The `*` universal selector matches every element in the document.

  5. Which combinator selects a direct child element?

    Answer: >

    The `>` child combinator selects direct children only.

  6. What does the `:nth-child(2n)` selector match?

    Answer: Every even-positioned child

    `2n` matches every even index, selecting even-positioned children.

  7. Which pseudo-element lets you insert generated content before an element?

    Answer: ::before

    `::before` inserts generated content at the start of an element.