Error CSS rule block missing its selector
Why a bare { ... } block with nothing before the brace is invalid, and common ways it happens.
The validator flags a { ... } block that has no selector text immediately before the opening brace.
Example
/* Wrong: no selector */
{
color: red;
}
/* Right */
.error-text {
color: red;
}This most often happens after deleting a selector while leaving its block behind, or after a previous rule's closing brace goes missing and merges two rules together — which makes what looks like a second selector get consumed as part of the first rule's body instead.
Why it matters
Every CSS rule needs a selector to tell the browser which elements the declarations apply to — a block with no selector is simply not a valid rule, and browsers skip it entirely (the CSS parsing spec is designed to be fault-tolerant, discarding what it can't interpret rather than failing the whole stylesheet). The declarations inside are silently dropped, with no visible error, which makes this a quiet source of "why isn't this style applying" confusion.
Frequently asked questions
Will the browser show an error for a selector-less block?
No — CSS is designed to fail gracefully. The browser's parser just discards the invalid rule and keeps parsing the rest of the stylesheet, so there's no console error to point you at the problem.
Is this the same issue as an unclosed brace?
Related but distinct. An unclosed brace merges rules together and misparses everything after it. A missing selector is a single block, correctly braced, that simply has nothing identifying which elements it targets.