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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4.1.2 Keywords<br />

Keywords have the form of identifiers. Keywords must not be placed between<br />

quotes ("..." or ’...’). Thus,<br />

red<br />

is a keyword, but<br />

"red"<br />

is not. (It is a string [p. 50] .) Other illegal examples:<br />

Illegal example(s):<br />

width: "auto";<br />

border: "none";<br />

font-family: "serif";<br />

background: "red";<br />

4.1.3 Characters and case<br />

The following rules always hold:<br />

All CSS style sheets are case-insensitive, except for parts that are not under<br />

the control of CSS. For example, the case-sensitivity of values of the HTML<br />

attributes "id" and "class", of font names, and of URIs lies outside the scope<br />

of this specification. Note in particular that element names are case-insensitive<br />

in HTML, but case-sensitive in XML.<br />

In <strong>CSS2</strong>, identifiers (including element names, classes, and IDs in selectors<br />

[p. 53] ) can contain only the characters [A-Za-z0-9] and ISO 10646 characters<br />

161 and higher, plus the hyphen (-); they cannot start with a hyphen or a<br />

digit. They can also contain escaped characters and any ISO 10646 character<br />

as a numeric code (see next item). For instance, the identifier "B&W?"<br />

may be written as "B\&W\?" or "B\26 W\3F".<br />

Note that Unicode is code-by-code equivalent to ISO 10646 (see<br />

[UNICODE] and [ISO10646]).<br />

In <strong>CSS2</strong>, a backslash (\) character indicates three types of character<br />

escapes.<br />

First, inside a string [p. 50] , a backslash followed by a newline is ignored<br />

(i.e., the string is deemed not to contain either the backslash or the newline).<br />

Second, it cancels the meaning of special CSS characters. Any character<br />

(except a hexadecimal digit) can be escaped with a backslash to remove its<br />

special meaning. For example, "\"" is a string consisting of one double<br />

quote. <strong>Style</strong> sheet preprocessors must not remove these backslashes from a<br />

style sheet since that would change the style sheet’s meaning.<br />

Third, backslash escapes allow authors to refer to characters they can’t<br />

easily put in a document. In this case, the backslash is followed by at most<br />

six hexadecimal digits (0..9A..F), which stand for the ISO 10646<br />

([ISO10646]) character with that number. If a digit or letter follows the<br />

hexadecimal number, the end of the number needs to be made clear. There<br />

are two ways to do that:<br />

1. with a space (or other whitespace character): "\26 B" ("&B")<br />

2. by providing exactly 6 hexadecimal digits: "\000026B" ("&B")<br />

38

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

Saved successfully!

Ooh no, something went wrong!