Unclosed CSS Bracket
Every opening { in CSS needs a matching closing }. When a closing bracket is missing, every rule after it becomes part of the unclosed block. This can break dozens of rules at once, far from the actual error location.
Why It Matters
An unclosed bracket is the most destructive CSS syntax error. Everything after the missing } is swallowed into the previous rule, potentially breaking your entire stylesheet from that point forward.
Code Examples
.header {
background: #333;
color: white;
padding: 20px;
/* missing closing } */
.main {
padding: 40px;
}
.footer {
background: #333;
}.header {
background: #333;
color: white;
padding: 20px;
}
.main {
padding: 40px;
}
.footer {
background: #333;
}How to Fix
- 1When multiple rules suddenly stop working, look for a missing } above them.
- 2Use editor bracket matching (VS Code highlights matching braces).
- 3Indent your CSS consistently so missing brackets are visually obvious.
- 4A CSS validator reports the exact location of unclosed brackets.
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
Missing Semicolon in CSS
Why missing semicolons break CSS rules and how to find them. The most common CSS syntax error.
Empty CSS Rule
Why empty CSS rules bloat your stylesheet. How to find and remove unused selectors.
Invalid CSS Selector
Common CSS selector mistakes: missing dots, wrong syntax, invalid pseudo-classes. How to fix them.