22.12.2013 Views

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

In fact, these two methods may be combined. Only one whitespace character<br />

is ignored after a hexadecimal escape. Note that this means that a<br />

"real" space after the escape sequence must itself either be escaped or<br />

doubled.<br />

Backslash escapes are always considered to be part of an identifier [p. 38]<br />

or a string (i.e., "\7B" is not punctuation, even though "{" is, and "\32" is<br />

allowed at the start of a class name, even though "2" is not).<br />

4.1.4 Statements<br />

A CSS style sheet, for any version of CSS, consists of a list of statements (see<br />

the grammar above). There are two kinds of statements: at-rules and rule sets.<br />

There may be whitespace [p. 37] around the statements.<br />

In this specification, the expressions "im<strong>media</strong>tely before" or "im<strong>media</strong>tely<br />

after" mean with no intervening whitespace or comments.<br />

4.1.5 At-rules<br />

At-rules start with an at-keyword, an ’@’ character followed im<strong>media</strong>tely by an<br />

identifier [p. 38] (for example, ’@import’, ’@page’).<br />

An at-rule consists of everything up to and including the next semicolon (;) or<br />

the next block, [p. 40] whichever comes first. A CSS user agent that encounters<br />

an unrecognized at-rule must ignore [p. 42] the whole of the at-rule and continue<br />

parsing after it.<br />

<strong>CSS2</strong> user agents must ignore [p. 42] any ’@import’ [p. 71] rule that occurs<br />

inside a block [p. 40] or that doesn’t precede all rule sets.<br />

Illegal example(s):<br />

Assume, for example, that a <strong>CSS2</strong> parser encounters this style sheet:<br />

@import "subs.css";<br />

H1 { color: blue }<br />

@import "list.css";<br />

The second ’@import’ is illegal according to <strong>CSS2</strong>. The <strong>CSS2</strong> parser ignores<br />

[p. 42] the whole at-rule, effectively reducing the style sheet to:<br />

@import "subs.css";<br />

H1 { color: blue }<br />

Illegal example(s):<br />

In the following example, the second ’@import’ rule is invalid, since it occurs<br />

inside a ’@<strong>media</strong>’ block [p. 40] .<br />

@import "subs.css";<br />

@<strong>media</strong> print {<br />

@import "print-main.css";<br />

BODY { font-size: 10pt }<br />

}<br />

H1 {color: blue }<br />

39

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!