Coding task · HTML and CSS course · Module 3: CSS Basics
Cascade in practice
Three rules style the same element: an element, a class and an ID selector. ID > class > element. Uncomment the rules and check which style wins.
Task
Uncomment the commented-out CSS rules in style.css (the element selector p, the class selectors .river/.styled and the ID selectors #nile/#special). Observe that the ID selector wins over the class, and the class wins over the element selector.