CSS has no effect

  • CSS

Why it happens

  • The name is different, or the dot (class) or # (id) is missing.
  • A ; or } is missing, so the next rules are ignored.
  • The style sheet isn't linked.

How to fix it

  1. Check .name matches class="name", capitals too.
  2. Check each line ends with ; and each rule with }.
  3. Right-click > Inspect and look whether the rule shows, or is crossed out.
  4. Check <link rel="stylesheet" href="style.css">.

It worked if: Add border: 3px solid red to the rule: a red box appears.

From how the part works. How CSS works.

Didn't help? Search another error or ask us.