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
.card {
background: #fff /* missing semicolon */
border-radius: 8px;
padding: 20px;
color: #333 /* missing semicolon */
font-size: 14px;
}.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 ValidatorHostinger — Fast & Affordable Web Hosting
Deploy clean, validated CSS on reliable hosting.
Related CSS Errors
Unclosed CSS Bracket
How unclosed curly braces break your entire stylesheet. Find and fix missing closing brackets.
Invalid CSS Property Value
Learn why CSS property values are invalid and how to fix them. Common mistakes with colors, units, and keywords.
Empty CSS Rule
Why empty CSS rules bloat your stylesheet. How to find and remove unused selectors.