</>
ValidateHTML

Missing Semicolon in CSS

Every CSS declaration must end with a semicolon. When you forget one, the browser tries to parse the next line as part of the current value. This usually breaks both the current declaration AND the next one.

Why It Matters

A missing semicolon is the most common CSS syntax error. It silently breaks two rules at once: the one missing the semicolon and the one after it. This makes it especially confusing because the rule that appears broken isn't the one with the actual error.

Code Examples

Bad CSS
.card {
  background: #fff     /* missing semicolon */
  border-radius: 8px;
  padding: 20px;
  color: #333          /* missing semicolon */
  font-size: 14px;
}
Good CSS
.card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  color: #333;
  font-size: 14px;
}

How to Fix

  • 1Always end every CSS declaration with a semicolon, including the last one in a block.
  • 2When a CSS rule doesn't work, check the line ABOVE it for a missing semicolon.
  • 3Use a CSS validator to catch missing semicolons automatically.
  • 4Configure your editor to auto-insert semicolons (Prettier, stylelint).

Check Your CSS Now

Our CSS validator detects this error automatically and shows the exact line number.

Open CSS Validator
Recommended

Hostinger Fast & Affordable Web Hosting

Deploy clean, validated CSS on reliable hosting.

Get 80% Off Hosting →

Related CSS Errors

View all CSS errors