(Fundamentals, Colors, and Styling) 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 (Fundamentals, Colors, and Styling) flashcards as text
Which CSS property sets the background color of an element?
Answer: background-color
background-color sets the color behind the element's content.
What is the default value of the 'color' property if not specified?
Answer: Inherited from the parent
The color property is inherited, so it takes the parent's value by default.
Which of these is a valid way to apply CSS directly to one HTML element?
Answer: Inline style attribute
Inline CSS uses the style attribute on the element itself.
What does the CSS property 'opacity: 0.5;' do?
Answer: Makes the element 50% transparent
Opacity 0.5 renders the element at 50% transparency.
Which shorthand hex code is equivalent to #FF0000?
Answer: #F00
#F00 expands to #FF0000, which is pure red.
How is an external stylesheet linked to an HTML document?
Answer:
A element with rel='stylesheet' references an external CSS file.
What color does the named CSS keyword 'transparent' produce?
Answer: Fully see-through
The 'transparent' keyword equals a fully transparent color (alpha 0).