</>
ValidateHTML

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.

Find this error in your own code. Paste your CSS or enter a page URL, free and instant.Open the CSS validator
7.1%
of sites tested

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

Bad CSS
.header {
  background: #333;
  color: white;
  padding: 20px;
/* missing closing } */

.main {
  padding: 40px;
}

.footer {
  background: #333;
}
Good CSS
.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?
Without the closing brace, the parser treats everything that follows as still inside the unclosed rule. Every later selector and declaration gets swallowed, so the damage cascades to the end of the file.
How do I find the unclosed bracket?
Use your editor's bracket matching: click a brace and it highlights its pair, or shows nothing when the pair is missing. Consistent indentation and a CSS validator both make the gap obvious.
Does a missing closing brace affect other stylesheets?
No, the damage is contained to the file with the error. Other linked stylesheets parse independently, but everything after the unclosed brace in that one file is lost.

Check Your CSS Now

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

Open CSS Validator

Related CSS Errors

View all CSS errors