04 Explained solutions

Compare the reasoning, not just the final appearance. Other correct solutions can satisfy the same requirements.

1. Shared class

.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.

2. Specificity before source order

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.

3. Inheritance

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.

Return to practice · Return to lesson