(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
Which property sets the background color of an element?
Answer: background-color
background-color sets the element's background fill color.
What does the selector "input[type=\"text\"]" match?
Answer: Input elements whose type attribute equals text
An attribute selector in brackets matches elements with the specified attribute value.
Which pseudo-element styles the first line of a paragraph?
Answer: p::first-line
The ::first-line pseudo-element targets the first rendered line of text.
What is the correct way to write an inline style on an element?
Answer:
Inline styles use the style attribute containing CSS declarations.
Which property controls the typeface used for text?
Answer: font-family
font-family specifies a prioritized list of font names.
What does the selector "h1, h2, h3" do?
Answer: Applies the same styles to all three heading types
Commas group selectors so one rule applies to each listed element.
Which selector targets every that is the first child of its parent?
Answer: li:first-child
The :first-child pseudo-class matches an element that is the first child of its parent.