HTML/CSS · Module 4
Answers and explanations · Explain how CSS chooses a style
Compare these references after your own attempt. You can read them at any time; they do not record a live model or vendor run.
HTML/CSS · Module 4
Compare these references after your own attempt. You can read them at any time; they do not record a live model or vendor run.
Compare the reasoning, not just the final appearance. Other correct solutions can satisfy the same requirements.
.event-card { background: #edf4eb; }Every article with the class matches. An id repeated on all three would be incorrect; classes are designed for this repeated role.
The hint paragraph is maroon. Its class selector outranks the plain element selector under the stated conditions. Moving p later does not reverse that comparison. Two matching .hint rules would tie and use source order.
The paragraph normally inherits the body’s text color, but not its border. A border on body outlines body’s box, not each paragraph. Setting p { color: ... } gives the paragraph a direct declaration, replacing the inherited color. This is not a case of a low-specificity child “beating” a parent in the same selector contest.