|
1 | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
2 | 2 | <html lang="en"> |
3 | | -<!-- $Id: page.src,v 1.10 1997-10-30 08:37:26 ian Exp $ --> |
| 3 | +<!-- $Id: page.src,v 1.11 1997-11-20 23:44:17 ian Exp $ --> |
4 | 4 | <HEAD> |
5 | 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
6 | 6 | <TITLE>Paged media</TITLE> |
@@ -478,163 +478,12 @@ Future versions of CSS may include other page pseudo-classes (e.g., |
478 | 478 | </em> |
479 | 479 | </div> |
480 | 480 |
|
481 | | -<h3>Running headers and footers</h3> |
482 | | - |
483 | | -<p>It is customary in printed documents to put navigation aids at the |
484 | | -top and/or bottom of the page. Often you'll find a page number, the |
485 | | -name of the book, and the title of the current chapter there. |
486 | | - |
487 | | -<p>CSS defines two areas of the page for holding this kind of |
488 | | -information. They are referred to as the <span class="index-def" |
489 | | -title=":header">:header</span> and <span class="index-def" |
490 | | -title=":footer">:footer</span> pseudo-elements, since their default |
491 | | -position is above (resp., below) the content of the page. Their content |
492 | | -and other properties are defined inside an @page rule: |
493 | | - |
494 | | -<pre> |
495 | | -@page :footer {... footer properties... } |
496 | | -@page :header {... header properties... } |
497 | | -</pre> |
498 | | - |
499 | | -<p>Since left and right pages often have different headers and |
500 | | -footers, the following defines them individually: |
501 | | - |
502 | | -<pre> |
503 | | -@page :left :footer {...} /* footer of the left page */ |
504 | | -@page :right :footer {...} /* footer of the right page */ |
505 | | -@page :left :header {...} /* header of the left page */ |
506 | | -@page :right :header {...} /* header of the right page */ |
507 | | -</pre> |
508 | | - |
509 | | -<p>The <a href="cascade.html">cascading rules</a> determine what the |
510 | | -values for properties are in case the same property is set on various |
511 | | -@page rules. The specificity of @page is 0, every :left, :right, |
512 | | -:footer, and :header adds 1 to the specificity. |
513 | | - |
514 | | -<p>The :footer and :header areas behave very similar to <span |
515 | | -class="index-inst" title="fixed"> <span |
516 | | -class="value-inst-fixed">'fixed'</span></span> elements. The only |
517 | | -difference is in their content: in headers and footers the content is |
518 | | -limited to one line, and it may vary from page to page, since it can |
519 | | -include variables. The page content is the <a |
520 | | -href="flowobj.html#reference-box">reference box</a> for the header and |
521 | | -footer. See section <a href="flowobj.html#fixed-positioning">"fixed |
522 | | -positioning"</a> for a description of fixed elements. |
523 | | - |
524 | | -<p>The initial values for <span class="propinst-top">'top'</span>, |
525 | | -<span class="propinst-bottom">'bottom'</span> and <span |
526 | | -class="propinst-height">'height'</span> are different for :footer and |
527 | | -:header than for normal fixed elements: |
528 | | - |
529 | | -<ul> |
530 | | -<li><p><span class="propinst-top">'top'</span> in :header has a UA-dependent initial value. A suggested |
531 | | -value is -3em. |
532 | | -<li><p><span class="propinst-bottom">'bottom'</span> in :footer has a UA-dependent initial value. A |
533 | | -suggested value is -3em. |
534 | | -<li><p><span class="propinst-height">'height'</span> in both :header and :footer has a UA-dependent initial |
535 | | -value. A suggested value is 1em. |
536 | | -</ul> |
537 | | - |
538 | | -<p>The suggested values make the header and footer as wide as the page |
539 | | -content, and about two lines above (resp., below) it. |
540 | | - |
541 | | -<p>The content of the header and footer is specified with the <span |
542 | | -class="propinst-content">'content'</span> property. The content is |
543 | | -always rendered as a single line. (If the content is too long, the UA |
544 | | -should cut it off in some way.) The value is a comma-separated list of |
545 | | -1, 2, or 3 values. Depending on the <span |
546 | | -class="propinst-direction">'direction'</span> property, the first of |
547 | | -these is left- or right-aligned, the second is centered, and the third |
548 | | -is right- or left-aligned. |
549 | | - |
550 | | -<p>The content is a concatenation of fixed strings and variable |
551 | | -parts. The following variable parts are allowed: |
552 | | - |
553 | | -<p>[Are these the right names for the variables?] |
554 | | - |
555 | | -<dl> |
556 | | -<dt>lower-roman(pageno), upper-roman(pageno), decimal(pageno), |
557 | | -lower-alpha(pageno), upper-alpha(pageno) |
558 | | -<dd>This expands to the page number, in the specified notation.</dd> |
559 | | - |
560 | | -<dt>lower-roman(pages), upper-roman(pages), decimal(pages), |
561 | | -lower-alpha(pages), upper-alpha(pages) |
562 | | -<dd>This expands to the total number of pages, in the specified |
563 | | -notation.</dd> |
564 | | - |
565 | | -<dt>first(<var>X</var>), last(<var>X</var>), previous(<var>X</var>) |
566 | | -<dd><var>X</var> can be one of 'title', 'chapter', or |
567 | | -'section'. First(<var>X</var>) expands to the content of the first |
568 | | -element on the page that has a <span |
569 | | -class="propinst-running-head">'running-head:<var>X</var>'</span> |
570 | | -property. If there is none, 'first()' is the same as |
571 | | -'previous()'. 'Last(<var>X</var>)' expands to the content of the last |
572 | | -element on the page with a 'running-head:<var>X</var> property. If |
573 | | -there is none, 'last' is the same as |
574 | | -'previous'. 'Previous(<var>X</var>)' expands to the contents of the |
575 | | -last element with 'running-head:<var>X</var>' on all pages before this |
576 | | -one. If there is none, the result is the empty string.</dd> |
577 | | - |
578 | | -<dt>url |
579 | | -<dd>This expands to the URL of the document (not of the style sheet).</dd> |
580 | | - |
581 | | -<dt>date |
582 | | -<dd>This expands to the current date, in the user's locale and format.</dd> |
583 | | -</dl> |
584 | | - |
585 | | -<p>The "contents" is the text content of the element and all its |
586 | | -children, excluding the content of elements that have <span |
587 | | -class="propinst-display">'display:none'</span>. |
588 | | - |
589 | | -<div class="example"> |
590 | | -<p>This example creates two running headers, the one on the left page |
591 | | -has a page number on the left, and the content of the first element |
592 | | -marked as 'chapter' on the right. The right header has the content of |
593 | | -the last element marked as 'section' on the left and the page number |
594 | | -on the right. Both headers are in 10pt small-caps. |
595 | | - |
596 | | -<pre> |
597 | | -@page :left: header { |
598 | | - content: "Page " decimal(pageno), , first(chapter); |
599 | | - font-variant: small-caps |
600 | | -} |
601 | | -@page :right :header { |
602 | | - content: last(section), , "Page " decimal(pageno); |
603 | | - font-variant: small-caps |
604 | | -} |
605 | | -</pre> |
606 | | -</div> |
607 | | - |
608 | | -<h3>Marking elements for the running headers & footers</h3> |
609 | | - |
610 | | -<p>To put a copy of the content of an element in the header or footer, |
611 | | -the element must be marked. The property 'running-head' is used for |
612 | | -that. |
613 | | - |
614 | | -<!-- #include src=properties/running-head.srb --> |
615 | | - |
616 | | -The value 'none' means that the element is not marked. 'Title', |
617 | | -'chapter' and 'section' say that the element is marked as a title, |
618 | | -chapter or section, resp. and that the content can be used in the |
619 | | -running header or footer. |
620 | | - |
621 | | -<div class="example"> |
622 | | -<p>This style sheet marks H2 elements as 'chapter' and DT elements as |
623 | | -'section'. This can be used, e.g., in combination with the running |
624 | | -headers of the previous example. |
625 | | - |
626 | | -<pre> |
627 | | -H2 {running-head: chapter} |
628 | | -DT {running-head: section} |
629 | | -</pre> |
630 | | -</div> |
631 | | - |
632 | 481 | <h3>Content outside the page box</h3> |
633 | 482 |
|
634 | 483 | <P>When formatting content in the page model, some content may end up |
635 | 484 | outside the page box. For example, an element with 'white-space: pre' |
636 | 485 | may be wider than the page box. Also, when elements are positioned |
637 | | -outside the <a href="../flowobj.html#flow-model">flow model</a>, they |
| 486 | +outside the <a href="flowobj.html#flow-model">flow model</a>, they |
638 | 487 | may end up in inconvenient locations. For example, images may be |
639 | 488 | placed on the edge of the page box or 100,000 inches below the page |
640 | 489 | box. |
|
0 commit comments