Skip to content
Justice Tech School

Why CSS Does Not Apply

Common reasons: a typo in a property, a missing semicolon, a more specific rule winning, a stylesheet that did not load or the wrong selector. Use the inspector to see crossed out rules.

Example
<style>
.note { color: red; colour: blue; background: #1e293b; padding: 8px } p.note { color: #fbbf24 }
</style>
<p class="note">colour is not a property; the more specific rule wins</p>

Exercise

Which wins, p.note or .note?

 selector

Quiz Test

Why might a rule not apply?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.