topskill.dev
CoursesTracks
0
All courses/CSSResolve Specificity
CSS Foundations
8 / 10
← CSS
○CSS Rule Style an Exhibit Card○Write Your First CSS Rule○CSS Selectors Target Exhibit Details○Target Exhibit Details○Apply CSS Three Sources○Apply CSS Three Ways○Specificity Resolve a Style Conflict●Resolve Specificity○Inheritance and the cascade✦Module Quiz
○Color Palette○Color Palette○Background Layer○Background Layer○Type Rhythm○Type Rhythm○Borders and Shadows○Borders and Shadows✦Module Quiz
○Box Model Seed Packet Card○Space a Seed Packet○Display Swap Table Labels○Arrange Swap Table Labels○Positioning Pickup Pin○Pin the Pickup Location○Sizing and Overflow○Size a Seed-Swap Notice○Sticky scroll headings✦Module Quiz
○Advanced Selectors Book Cart Sign○Target a Book Cart Sign○Pseudo-Classes Night Cart States○Style Night Cart States○Pseudo-Elements○Add a Book-Quote Mark✦Module Quiz
○Lantern Market navigation○Lantern Market navigation✦Module Quiz
○Community garden request card○Community garden request card✦Module Quiz
○Flex Direction○Flex Direction○Main-Axis Spacing○Main-Axis Spacing○Cross-Axis Alignment○Cross-Axis Alignment○Wrapping and Flex Items○Wrapping and Flex Items○Flexbox Navigation○Flexbox Navigation✦Module Quiz
○Grid Tracks○Grid Tracks○Grid Gaps○Grid Gaps○Grid Placement○Grid Placement○Responsive Grid○Responsive Grid✦Module Quiz
○River radio schedule○Harbor radio schedule✦Module Quiz
○Field note color system○Field note color system○Transforms○Rotate a Field Note○Resilient styles✦Module Quiz
○Kite festival signal○Garden festival signal✦Module Quiz
○Garden forecast○Harbor forecast○Fluid sizing○Fluid weather bulletin○Images that fit✦Module Quiz
○Seed inventory table○Tool checkout table✦Module Quiz
○Community maker profile○Maker profile sheet✦Module Quiz

Resolve Specificity

Resolve the gallery notice's color

The demo's #intro paragraph is now a new notice with class alert and ID opening. Keep the HTML unchanged and add these ordinary rules in style.css; do not use inline styles or !important to force the result. The !important marker changes declaration priority; leave it out while comparing these selectors.

Each rule is a separate task even though the more specific rules hide the earlier colors. Submit checks all three rules, not just whether the final paragraph happens to be green.

Your Task

  1. Add p { color: gray; }.
  2. Add .alert { color: orange; }.
  3. Add #opening { color: green; }.

Watch the winner change

Run and Submit after each task. With only the element rule, the note is gray. Adding the class rule makes it orange. Adding the ID rule makes it green. The earlier rules are still valid; they simply lose the color conflict on this element.

After the foundations quiz, you will use these selectors to style a night-market flyer.

Hint 1
1 / 1
HINT 1

ID selectors outrank class selectors, which outrank element selectors.

Files
  • ⋄index.html
  • ⋄style.css
Loading editor…