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.
How common is this error?
We ran this validator over the home page of the Tranco top 5,000 websites in August 2026. 188 of the 2,656 sites we could reach hit it. That makes it the 3rd most common CSS problem we found, across 244 occurrences. See the full study.
Most frequent wording: Unexpected end of input
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.
Common Causes
- Deleting a rule but leaving its opening brace, or removing the closing brace by accident.
- Nesting a media query or at-rule and closing only the inner block, not the outer one.
- Pasting a snippet whose braces were not balanced to begin with.
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.
Frequently Asked Questions
Why do so many rules break from one missing brace?
How do I find the unclosed bracket?
Does a missing closing brace affect other stylesheets?
Check Your CSS Now
Our CSS validator detects this error automatically and shows the exact line number.
Open CSS ValidatorRelated CSS Errors
Missing Semicolon in CSS
A missing semicolon is the most common CSS error, and it quietly breaks two rules at once. Learn why it happens and how to find and fix it in seconds.
Empty CSS Rule
Empty CSS rules add bytes and clutter without doing anything useful. Learn why they appear, how to find unused selectors, and how to clean them up now.
Invalid CSS Selector
Fix invalid CSS selectors that silently discard a whole rule: missing dots, misspelled pseudo-classes, and broken attribute selector syntax explained.