107) and :first-line (p. 110).
Here are some additional examples that demonstrate more advanced usage of
generated content, including the use of the counter-increment (p. 352) and
counter-reset (p. 354) properties.
This style rule adds the URI, enclosed in angle brackets, after links when the
document??™s printed to paper:
@media print {
a[href]:after {
content: "<" attr(href) ">";
}
}
These CSS3 style rules format paragraphs within a block quotation in the way that??™s
common in (American) English novels:
SPEC
version initial inherited
CSS2, 2.1 normal NO
BROWSER SUPPORT
Op9.2+ Saf1.3+ FF1.5+ IE7
PARTIAL PARTIAL PARTIAL NONE
349 Generated Content
blockquote p {
margin: 0;
text-indent: 1em;
quotes: "\201c" "\201d";
}
blockquote p:first-of-type {
text-indent: 0;
}
blockquote p::before {
content: open-quote;
}
blockquote p::after {
content: no-close-quote;
}
blockquote p:last-of-type::after {
content: close-quote;
}
These style rules add the word ???Chapter??? and a chapter number before every h1
heading, and prefix every h2 heading with the chapter number and a section number:
body {
counter-reset: chapter;
}
h1 {
counter-increment: chapter;
counter-reset: section;
}
h2 {
counter-increment: section;
}
h1:before {
content: "Chapter " counter(chapter) ": ";
}
h2:before {
content: counter(chapter) ".
Pages:
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512