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.

12 Generated content, automatic numbering,<br />

and lists<br />

Contents<br />

12.1 The :before and :after pseudo-elements . . . . . . . 153 .<br />

12.2 The ’content’ property . . . . . . . . . . . 155 .<br />

12.3 Interaction of :before and :after with ’compact’ and ’run-in’ elements 156 .<br />

12.4 Quotation marks . . . . . . . . . . . . 157 .<br />

12.4.1 Specifying quotes with the ’quotes’ property . . . . 157 .<br />

12.4.2 Inserting quotes with the ’content’ property . . . . 159 .<br />

12.5 Automatic counters and numbering . . . . . . . . 160 .<br />

12.5.1 Nested counters and scope . . . . . . . . 162 .<br />

12.5.2 Counter styles . . . . . . . . . . . 163 .<br />

12.5.3 Counters in elements with ’display: none’ . . . . . 163 .<br />

12.6 Markers and lists . . . . . . . . . . . . 163 .<br />

12.6.1 Markers: the ’marker-offset’ property . . . . . . 164 .<br />

12.6.2 Lists: the ’list-style-type’, ’list-style-image’, ’list-style-position’, and<br />

’list-style’ properties . . . . . . . . . . . . 168 .<br />

In some cases, authors may want user agents to render content that does not<br />

come from the document tree [p. 30] . One familiar example of this is a numbered<br />

list; the author does not want to list the numbers explicitly, he or she wants the<br />

user agent to generate them automatically. Similarly, authors may want the user<br />

agent to insert the word "Figure" before the caption of a figure, or "Chapter 7"<br />

before the seventh chapter title. For audio or braille in particular, user agents<br />

should be able to insert these strings.<br />

In <strong>CSS2</strong>, content may be generated by several mechanisms:<br />

The ’content’ property, in conjunction with the :before and :after<br />

pseudo-elements.<br />

The ’cue-before’, ’cue-after’ aural properties (see the chapter on aural style<br />

sheets [p. 277] ). When the ’content’ property is combined with the aural<br />

properties they are rendered in the following order: :before, ’cue-before’,<br />

(’pause-before’), the element’s content, (’pause-after’), ’cue-after’, and :after.<br />

Elements with a value of ’list-item’ for the ’display’ property.<br />

Below we describe the mechanisms associated with the ’content’ property.<br />

12.1 The :before and :after pseudo-elements<br />

Authors specify the style and location of generated content with the :before and<br />

:after pseudo-elements. As their names indicate, the :before and :after<br />

pseudo-elements specify the location of content before and after an element’s<br />

document tree [p. 30] content. The ’content’ property, in conjunction with these<br />

pseudo-elements, specifies what is inserted.<br />

153

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

Saved successfully!

Ooh no, something went wrong!