4 Syntax and basic data types

4.1 Syntax

This section describes a grammar (and forward-compatible parsing rules) common to any level of CSS (including CSS 2.1). Future updates of CSS will adhere to this core syntax, although they may add additional syntactic constraints.

These descriptions are normative. They are also complemented by the normative grammar rules presented in Appendix G.

In this specification, the expressions "immediately before" or "immediately after" mean with no intervening white space or comments.

4.1.1 Tokenization

All levels of CSS — level 1, level 2, and any future levels — use the same core syntax.

This allows UAs to parse (though not completely understand) style sheets written in levels of CSS that did not exist at the time the UAs were created. Designers can use this feature to create style sheets that work with older user agents, while also exercising the possibilities of the latest levels of CSS.

At the lexical level, CSS style sheets consist of a sequence of tokens. The list of tokens for CSS is as follows. The definitions use Lex-style regular expressions. Octal codes refer to ISO 10646 ( [ISO10646] ). As in Lex, in case of multiple matches, the longest match determines the token.