</>
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.

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

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.

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