Opera and Safari 3 (partially) also support content in contexts other than the
:before and :after pseudo-elements. In these cases, the content of the element is
replaced by the value of the content property.
Other Relevant Stuff
:before (p. 113)
specifies content to be inserted before another element
:after (p. 114)
specifies content to be inserted after another element
counter-increment
counter-increment: { identifier [integer]1 or more pairs
| none | inherit } ??¦;
This property increments one or more
counter values.
A counter is identified by a name that??™s
normally established by using the
counter in the counter-reset (p. 354)
property. Counters can be nested: if an
element has the counter C, and a child
element resets that counter name, it
won??™t reset the parent??™s counter, but
instead will create a new, nested
counter, C.
Example
These style rules prepend a number to all
h2 headings, incrementing the value for
each heading:
h1 {
counter-reset: section;
}
h2:before {
counter-increment: section;
content: counter(section) ".
Pages:
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517