-
Notifications
You must be signed in to change notification settings - Fork 790
Expand file tree
/
Copy pathpage.src
More file actions
175 lines (133 loc) · 5.96 KB
/
page.src
File metadata and controls
175 lines (133 loc) · 5.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang="en">
<!-- $Id: page.src,v 2.32 2002-07-08 14:57:51 bbos Exp $ -->
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<TITLE>Paged media</TITLE>
</HEAD>
<BODY>
<H1 align="center"><a name="the-page">Page breaks</a></H1>
<P>Paged media (e.g., paper, transparencies, pages that are
displayed on computer screens, etc.) differ from
<a href="./media.html#continuous-media-group">continuous media</a>
in that the content of the document is split into one or more discrete
pages.
<P>CSS 2.1 has three properties that indicate where the user agent may
or should break pages, and on what page (left or right) the subsequent
content should resume. Each page break ends layout in the current page
and causes remaining pieces of the <a
href="conform.html#doctree">document tree</a> to be laid out on a new
page.
<h2><a name="page-break-props">Page break properties</a>: <span
class="propinst-page-break-before">'page-break-before'</span>,
<span class="propinst-page-break-after">'page-break-after'</span>,
<span class="propinst-page-break-inside">'page-break-inside'</span>
</h2>
<!-- #include src=properties/page-break-before.srb -->
<!-- #include src=properties/page-break-after.srb -->
<!-- #include src=properties/page-break-inside.srb -->
<P>Values for these properties have the following meanings:</p>
<dl>
<dt><strong>auto</strong></dt>
<dd>Neither force nor forbid a page break before (after, inside) the
generated box.
<dt><strong>always</strong></dt>
<dd>Always force a page break before (after) the
generated box.</dd>
<dt><strong>avoid</strong></dt>
<dd>Avoid a page break before (after, inside) the generated box.
<dt><strong>left</strong></dt>
<dd>
Force one or two page breaks before
(after) the generated box
so that the next page is formatted as a left page.</dd>
<dt><strong>right</strong></dt>
<dd>
Force one or two page breaks before (after) the generated
box so that the next page is formatted as a right page.</dd>
</dl>
<P>Whether the first page of a document is a left page or a right page
is not defined in this specification. A conforming user agent may
interpret the values 'left' and 'right' as 'always'.
<P>A potential page break location is typically under the influence
of the parent element's <span
class="propinst-page-break-inside">'page-break-inside'</span>
property, the <span
class="propinst-page-break-after">'page-break-after'</span> property
of the preceding element, and the <span
class="propinst-page-break-before">'page-break-before'</span> property
of the following element. When these properties have values other
than 'auto', the values 'always', 'left', and 'right' take precedence
over 'avoid'.
<P>These properties only apply to non-floating block-level elements.
Also, page breaks cannot be forced to occur inside table cells, <a
href="visuren.html#absolute-positioning">absolutely positioned</a>
boxes, and <a href="visuren.html#fixed-positioning">fixed</a>
positioned boxes. Page breaks set before, inside, or after such
elements must be ignored.
<h2><a name="allowed-page-breaks">Allowed page breaks</a></h2>
<p>In the normal flow, page breaks can occur at the following places:</p>
<ol>
<li>In the vertical margin between block boxes. When a page
break occurs here, the <a href="cascade.html#computed-value">computed
values</a> of the relevant
<span class="propinst-margin-top">'margin-top'</span>
and <span class="propinst-margin-bottom">'margin-bottom'</span>
properties are set to '0'.
<li>Between <a href="visuren.html#line-box">line boxes</a>
inside a <a href="visuren.html#block-box">block</a> box.
</ol>
<p>These breaks are subject to the following rules:
<ul>
<li><strong>Rule A:</strong> Breaking at (1) is allowed only if the <span
class="propinst-page-break-after">'page-break-after'</span> and <span
class="propinst-page-break-before">'page-break-before'</span> properties of all
the elements generating boxes that
meet at this margin allow it, which is when at least
one of them has the value 'always', 'left', or 'right', or when all of them are
'auto'.
<li><strong>Rule B:</strong> However, if all of them are 'auto' and
the nearest common ancestor of all the elements has a <span
class="propinst-page-break-inside">'page-break-inside'</span> value of
'avoid', then breaking here is not allowed.
<li><strong>Rule C:</strong> Breaking at (2) is allowed only if the <span
class="propinst-page-break-inside">'page-break-inside'</span> property
is 'auto'.
</ul>
<p>If the above rules do not provide enough break points to keep content
from overflowing the page boxes, then rules B and C are dropped in
order to find additional breakpoints. If that still does not lead to
sufficient break points, rule A is dropped as well.
<h2><a name="forced">Forced page breaks</a></h2>
<p>A page break <em>must</em> occur at (1) if, among the <span
class="propinst-page-break-after">'page-break-after'</span> and <span
class="propinst-page-break-before">'page-break-before'</span>
properties of all the elements generating boxes that meet at this
margin, there is at least one with the value 'always', 'left', or
'right'.
<h2>"Best" page breaks</h2>
<p>CSS 2.1 does not define which of a set of allowed page breaks
must be used; CSS 2.1 does not forbid a user agent from breaking at every
possible break point, or not to break at all. But CSS 2.1 does recommend
that user agents observe the following heuristics (while recognizing
that they are sometimes contradictory):</p>
<ul>
<li>Break as few times as possible.
<li>Make all pages that don't end with a forced break appear to have about
the same height.
<li>Avoid breaking inside a block that has a border.
<li>Avoid breaking inside a table.
<li>Avoid breaking inside a floated element
</ul>
</body>
</html>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-declaration:"~/SGML/HTML4.decl"
sgml-default-doctype-name:"html"
sgml-minimize-attributes:t
sgml-nofill-elements:("pre" "style" "br")
sgml-live-element-indicator:t
End:
-->