โ† 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 matches elements whose class attribute contains the word "news"?

    Answer: [class~="news"]

    The ~= attribute selector matches a whitespace-separated word within the value.

  2. When two rules have equal specificity, which one wins?

    Answer: The one declared last in the stylesheet

    With equal specificity, source order decides and the later rule overrides.

  3. Which pseudo-element inserts generated content before an element's content?

    Answer: ::before

    The ::before pseudo-element with the content property inserts content at the start.

  4. What is the @import rule used for in CSS?

    Answer: Importing one stylesheet into another

    @import pulls the contents of another CSS file into the current stylesheet.

  5. Which property controls the size of text?

    Answer: font-size

    font-size sets the size of the font, often in px, em, or rem.

  6. Which has the highest specificity?

    Answer: An id selector

    ID selectors carry higher specificity than class or element selectors.

  7. How is an internal stylesheet added to an HTML document?

    Answer: Inside a element in the

    Internal CSS is placed within a element, typically in the document head.