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.

Example(s):<br />

An example without quotes:<br />

LI { list-style: url(http://www.redballs.com/redball.png) disc }<br />

Parentheses, commas, whitespace characters, single quotes (’) and double<br />

quotes (") appearing in a URI must be escaped with a backslash: ’\(’, ’\)’, ’\,’.<br />

Depending on the type of URI, it might also be possible to write the above<br />

characters as URI-escapes (where "(" = %28, ")" = %29, etc.) as described in<br />

[URI].<br />

In order to create modular style sheets that are not dependent on the absolute<br />

location of a resource, authors may use relative URIs. Relative URIs (as defined<br />

in [RFC1808]) are resolved to full URIs using a base URI. RFC 1808, section 3,<br />

defines the normative algorithm for this process. For CSS style sheets, the base<br />

URI is that of the style sheet, not that of the source document.<br />

Example(s):<br />

For example, suppose the following rule:<br />

BODY { background: url("yellow") }<br />

is located in a style sheet designated by the URI:<br />

http://www.myorg.org/style/basic.css<br />

The background of the source document’s BODY will be tiled with whatever<br />

image is described by the resource designated by the URI<br />

http://www.myorg.org/style/yellow<br />

User agents may vary in how they handle URIs that designate unavailable or<br />

inapplicable resources.<br />

4.3.5 Counters<br />

Counters are denoted by identifiers (see the ’counter-increment’ and<br />

’counter-reset’ properties). To refer to the value of a counter, the notation<br />

’counter()’ or ’counter(, )’ is used. The<br />

default style is ’decimal’.<br />

To refer to a sequence of nested counters of the same name, the notation is<br />

’counters(, )’ or ’counters(, ,<br />

)’. See "Nested counters and scope" [p. 162] in the chapter on<br />

generated content [p. 153] .<br />

In <strong>CSS2</strong>, the values of counters can only be referred to from the ’content’ property.<br />

Note that ’none’ is a possible : ’counter(x, none)’ yields an<br />

empty string.<br />

Example(s):<br />

Here is a style sheet that numbers paragraphs (P) for each chapter (H1). The<br />

paragraphs are numbered with roman numerals, followed by a period and a<br />

space:<br />

P {counter-increment: par-num}<br />

H1 {counter-reset: par-num}<br />

P:before {content: counter(par-num, upper-roman) ". "}<br />

47

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

Saved successfully!

Ooh no, something went wrong!