Debugging and review

Debug the cascade

Trace a wrong visual value back through matched rules, specificity, inheritance, custom properties, layers, and source order.

8 minute lesson

~~~

When a value is wrong, inspect the element instead of adding a stronger rule blindly.

  1. Find the property in the Computed panel.
  2. Expand it to see which declaration supplied the value.
  3. Inspect crossed-out competing declarations.
  4. Check inherited values and custom-property definitions.
  5. Confirm the selector matches the element you intended.

If the rule is absent, check whether the stylesheet loaded and whether an earlier syntax error affected parsing.

Fix the cause. A duplicate selector with higher specificity may hide the symptom, but it makes the next override harder.

Lesson completed

Take this course offline

Get every free book and course as PDF and EPUB files.

Get the download library →