CSS Syntax Errors

According to the CSS2.1 specification, a user agent should ignore the invalid parts of a style sheet. In general, a user agent should ignore:

  • a statement that’s an at-rule with an invalid at-keyword
  • a statement that’s a rule set with an invalid selector
  • a statement that’s a rule set with grouped selectors, one or more of which is invalid
  • a declaration with an invalid property name or value
  • a declaration with an unsupported property or value

However, in practice, the behavior of browsers varies, either because of browser bugs, or the incomplete implementation of CSS standards. See Workarounds, Filters, and Hacks for some examples of inconsistent browser behavior.

User-contributed notes

There are no comments yet.

Related Products