← All CSS Flashcard Decks

(Selectors, Appearance, & Files) 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 (Selectors, Appearance, & Files) flashcards as text
  1. Which selector targets an element with the exact id "header"?

    Answer: #header

    The hash (#) prefix selects an element by its id attribute.

  2. What does the selector "div p" match?

    Answer: Every descendant inside any

    A space between selectors creates a descendant combinator matching any nested element.

  3. Which selector matches an element only when the mouse is hovering over it?

    Answer: a:hover

    The :hover pseudo-class applies styles while the pointer is over the element.

  4. What is the correct syntax to link an external stylesheet in HTML?

    Answer:

    External stylesheets use the tag with rel="stylesheet" and an href attribute.

  5. Which property changes the text color of an element?

    Answer: color

    The color property sets the foreground text color.

  6. What does the universal selector "*" select?

    Answer: All elements on the page

    The asterisk is the universal selector matching every element.

  7. Which selector targets elements with class "box" that are direct children of a ?

    Answer: section > .box

    The > combinator selects only direct children, not deeper descendants.