-
Notifications
You must be signed in to change notification settings - Fork 790
Expand file tree
/
Copy pathpage.src
More file actions
692 lines (558 loc) · 24.4 KB
/
page.src
File metadata and controls
692 lines (558 loc) · 24.4 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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
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
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang="en">
<!-- $Id: page.src,v 2.15 1998-03-17 08:04:30 ijacobs 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">Paged media</a></H1>
<H2>Introduction to paged media</H2>
<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. To handle page breaks, CSS2
extends the <a href="visuren.html">visual rendering model</a>
as follows:</p>
<ol>
<li>The <a href="#page-box">page
box</a> extends the <a href="box.html#box-model">box
model</a> to allow authors to specify the size of a page, its margins,
etc.
<li>The <span class="index-def" title="page model"><dfn>page
model</dfn></span> extends the visual rendering layout model to
account for <a href="#page-breaks">page breaks.</a>
</ol>
<P>The CSS2 <a name="page-model">page model</a> specifies how a
document is formatted within a rectangular area -- the <a
href="#page-box">page box</a> -- that has a finite width and
height. The page box does not necessarily correspond to the real <span
class="index-def" title="sheet"><dfn>sheet</dfn></span> where the
document will ultimately be rendered (paper, transparency, screen,
etc.). The CSS page model specifies formatting in the page box, but
it is the user agent's responsibility to transfer the page box to the
sheet. Some transfer possibilities include:</P>
<ul>
<li>Transferring one page box to one sheet (e.g., single-sided printing).
<li>Transferring two page boxes to both sides of the same sheet (e.g.,
double-sided printing).
<li>Transferring N (small) page boxes to one sheet (called "n-up").
<li>Transferring one (large) page box to N x M sheets (called "tiling").
<li>Creating signatures. A signature is a group of pages
printed on a sheet, which, when folded and trimmed like a book, appear in their
proper sequence.
<li>Printing one document to several output trays.
<li>Outputting to a file.
</ul>
<P>Although CSS2 does not specify how user agents transfer page boxes
to sheets, it does include certain mechanisms for telling user agents
about the target sheet <a href="#page-size-prop">size and
orientation</a>.
<H2><a name="page-box">Page boxes</a>: the @page rule</H2>
<P>The <span class="index-def" title="page box"><dfn>page
box</dfn></span> is a rectangular region that contains two
embedded areas:</p>
<ul>
<li>The <span class="index-def" title="page area"><a
name="page-area"><dfn>page area</dfn></a></span>. The page
area includes the boxes laid out on that page.
The edges of the page area act as a <a
href="visuren.html#containing-block">containing block</a> for layout
that occurs between page breaks. It also acts as the <a
href="visuren.html#initial-containing-block">initial containing
block</a>.
<li>The margin area (see the <a href="box.html#box-margin-area">
margin area</a> of the box model).
</ul>
<div class="note"><P>
<em><strong>Note.</strong> In CSS2, the <a
href="./box.html#border-properties">border properties</a> and <a
href="./box.html#padding-properties">padding properties</a>
do not apply to pages; they may in the future.
</em>
</div>
<P>Authors specify the dimensions, orientation, margins, etc. of a
page box within an <span class="index-def" title="@page">@page</span>
rule. An @page rule consists of the keyword "@page", a page selector,
and a block of declarations (said to be in the <span class="index-def"
title="page-context"><a name="page-context"><dfn>page
context</dfn></a></span>).</p>
<P>The <span class="index-def" title="page selector"><dfn>page
selector</dfn></span> specifies for which pages the declarations
apply. In CSS2, page selectors may designate the first page,
all left pages, all right pages, or a page assigned a specific name.
</p>
<P>The dimensions of the page box are set with the <span
class="propinst-size">'size'</span> property. The <span
class="propinst-marks">'marks'</span> property specifies crop and
cross marks.
<div class="example"><P>
For example, the following @page rule sets the margins of the page to 2cm.
<pre>
@page { margin: 2cm }
</pre>
</div>
<h3><a name="page-margins">Page margins</a></h3>
<P>The <a href="box.html#margin-properties">margin properties</a>
(<span class="propinst-margin-top">'margin-top'</span>, <span
class="propinst-margin-right">'margin-right'</span>, <span
class="propinst-margin-bottom">'margin-bottom'</span>, <span
class="propinst-margin-left">'margin-left'</span>, and <span
class="propinst-margin">'margin'</span>) apply within the <a
href="#page-context">page context</a>. The following diagram shows the
relationships between the sheet, page box, and page margins:</P>
<P><img src="./images/page-info.gif" alt="Illustration of sheet, page box, and margin."></p>
<P>The CSS2 rules for <a
href="visudet.html#collapsing-margins">collapsing vertical margins</a>
apply to page margins as well. For example, the margin of the first
box on a page will collapse with the page margin.
<p>The <a href="#page-context">page context</a> has no notion of
fonts, so 'em' and 'ex' units are not allowed. Percentage values on
the margin properties are relative to the dimensions of the <a
href="#page-box">page box</a>. All other units associated with the
respective CSS2 properties are allowed.
<P>Due to negative margin values (either on the page box or on
elements) or <a href="visuren.html#absolute-positioning">absolute
positioning</a> content may end up outside the page box, but this
content may be "cut" -- by the user agent, the printer, or ultimately,
the paper cutter.
<h3><a name="page-size-prop">Page size</a>: the <span
class="propinst-size">'size'</span> property</h3>
<!-- #include src=properties/size.srb -->
<P>This property specifies the size and orientation of a page box.
<P>The size of a page box may either be "absolute" (fixed size) or
"relative" (scalable, i.e., fitting available sheet sizes). Relative
page boxes allow user agents to scale a document and make optimal use
of the target size.
<!-- Need substitute for this at end of previous paragraph:
"Absolute page boxes ensure precise formatting." -IJ -->
<P>Three values for the <span class="propinst-size">'size'</span>
property create a relative page box:</p>
<DL>
<DT><strong>auto</strong>
<DD>The page box will be set to the size and orientation of the
target sheet.
<DT><strong>landscape</strong>
<DD>Overrides the target's orientation. The page box is the same
size as the target, and the longer sides are horizontal.
<DT><strong>portrait</strong>
<DD>Overrides the target's orientation. The page box is the same
size as the target, and the shorter sides are horizontal.
</DL>
<div class="example"><P>
<p>In the following example, the outer edges of the page box will align
with the target. The percentage value on the <span
class="propinst-margin">'margin'</span> property is relative to the
target size so if the target sheet dimensions are
21.0cm x 29.7cm (i.e., A4), the margins are 2.10cm and 2.97cm.
<pre>
@page {
size: auto; /* auto is the initial value */
margin: 10%;
}
</pre>
</div>
<P>Length values for the <span class="propinst-size">'size'</span>
property create an absolute page box. If only one length value is
specified, it sets both the width and height of the page box (i.e.,
the box is a square). Since the page box is the <a
href="visuren.html#initial-containing-block">initial containing
block</a>, percentage values are not allowed for the <span
class="propinst-size">'size'</span> property.
<div class="example"><P>
For example:
<PRE>
@page {
size: 8.5in 11in; /* width height */
}
</PRE>
<P>The above example set the width of the page box to be 8.5in and the
height to be 11in. The page box in this example requires a target
sheet size of 8.5"x11" or larger.
</div>
<P>User agents may allow users to control the transfer of the page
box to the sheet (e.g., rotating an absolute page box that's
being printed).
<h4>Rendering page boxes that do not fit a target sheet</h4>
<P>If the page box does not fit the target sheet dimensions, the
user agent may choose to:</p>
<UL>
<LI>Rotate the page box 90° if this will make the page box fit.
<LI>Scale the page to fit the target.
</UL>
<P>The user agent should consult the user before performing these
operations.
<h4>Positioning the page box on the sheet</h4>
<P>When the page box is smaller than the target size, the user agent
is free to place the page box anywhere on the sheet. However, it is
recommended that the page box be centered on the sheet since this will
align double-sided pages and avoid accidental loss of information that
is printed near the edge of the sheet.
<h3><a name="crop-mark-prop">Crop marks</a>: the <span
class="propinst-marks">'marks'</span> property</h3>
<!-- #include src=properties/marks.srb -->
<p>In high-quality printing, marks are often added outside the
page box. This property specifies whether cross
marks or crop marks or both should be rendered just outside the <a
href="#page-box">page box</a> edge. Values have the following
meanings:</p>
<!--
<dl>
<dt><strong>crop</strong>
<dd><span class="index-def" title="crop marks"><dfn>Crop
marks</dfn></span> indicate where the page should be cut.
<dt><strong>cross</strong>
<dd><span
class="index-def" title="cross marks"><dfn>Cross marks</dfn></span>
(also known as register marks or registration marks) are used to align
sheets.
<dt><strong>none</strong>
<dd>Don't render any special marks.
</dl>
-->
<p><span class="index-def" title="crop marks"><dfn>Crop
marks</dfn></span> indicate where the page should be cut. <span
class="index-def" title="cross marks"><dfn>Cross marks</dfn></span>
(also known as register marks or registration marks) are used to align
sheets.
<P>Marks are visible only on absolute page boxes (see the <span
class="propinst-size">'size'</span> property). In relative page boxes,
the page box will be aligned with the target and the marks will be
outside the printable area.
<P>The size, style, and position of cross marks depend on the user
agent.
<h3>Left, right, and first pages</H3>
<P>When printing double-sided documents, the <a href="#page-box">page
boxes</a> on left and right pages should be different. This can be
expressed through two CSS pseudo-classes that may be defined in the
<a href="#page-context">page context</a>.
<P>All pages are automatically classified by user agents into either
the <span class="index-def"
title=":left|pseudo-class:::left">:left</span> or <span
class="index-def" title=":right|pseudo-class:::right">:right</span>
pseudo-class.
<div class="example"><P>
<PRE>
@page :left {
margin-left: 4cm;
margin-right: 3cm;
}
@page :right {
margin-left: 3cm;
margin-right: 4cm;
}
</PRE>
</div>
<P>If different declarations have been given for left and right pages,
the user agent must honor these declarations even if the user agent
does not transfer the page boxes to left and right sheets (e.g., a
printer that only prints single-sided).
<P>Authors may also specify style for the first page of a document
with the <span class="index-def"
title=":first|pseudo-class:::first">:first</span> pseudo-class:
<div class="example"><P>
<PRE>
@page { margin: 2cm } /* All margins set to 2cm */
@page :first {
margin-top: 10cm /* Top margin on first page 10cm */
}
</PRE>
</div>
<P>Whether the first page of a document is :left or :right depends on
the major writing direction of the document and is outside the scope
of this document. However, to force a :left or :right first page,
authors may insert a page break before the first generated box (e.g.,
in HTML, specify this for the BODY element).
<P>Properties specified in a :left (or :right) @page rule override
those specified in an @page rule that has no pseudo-class specified.
Properties specified in a :first @page rule override those specified
in :left (or :right) @page rules.
<div class="note"><P>
<em><strong>Note.</strong>
Adding declarations to the :left or :right pseudo-class does not
influence whether the document comes out of the printer double- or
single-sided (which is outside the scope of this specification).
</em>
</div>
<div class="note"><P>
<em><strong>Note.</strong>
Future versions of CSS may include other page pseudo-classes.
</em>
</div>
<!-- Add named pages. 27/2/98 -->
<h3>Content outside the page box</h3>
<P>When formatting content in the page model, some content may end up
outside the page box. For example, an element whose <span
class="propinst-white-space">'white-space'</span> property has the
value 'pre' may generate a box that is wider than the page box. Also,
when boxes are positioned <a
href="visuren.html#absolute-positioning">absolutely</a> or <a
href="visuren.html#floats">floated</a>, they may end up in
"inconvenient" locations. For example, images may be placed on the
edge of the page box or 100,000 inches below the page box.
<P>A specification for the exact formatting of such elements lies
outside the scope of this document. However, we recommend that authors
and user agents observe the following general principles concerning
content outside the page box:</p>
<ul>
<li>Content should be allowed slightly beyond the page box to allow
pages to "bleed".
<li>User agents should avoid generating a large number of empty page
boxes to honor the positioning of elements (e.g., you don't want to
print 100 blank pages). Note, however, that generating a small number
of empty page boxes may be necessary to honor the 'left' and 'right'
values for <span
class="propinst-page-break-before">'page-break-before'</span> and
<span class="propinst-page-break-after">'page-break-after'</span>.
<li>Authors should not position elements in inconvenient locations
just to avoid rendering them. Instead:
<ul>
<li>To suppress box generation entirely, set the <span
class="propinst-display">'display'</span> property to 'none'.
<li>To render a box invisible, use the <span
class="propinst-visibility">'visibility'</span> property.
</ul>
<LI>User agents may handle boxes positioned outside the page box in
several ways, including discarding them or creating page boxes for
them at the end of the document.
</ul>
<H2><a name="page-breaks">Page breaks</a></H2>
<P>The following sections explain page formatting in CSS2. Five
properties 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 <a href="#page-box">page
box</a> and causes remaining pieces of the <a
href="conform.html#doctree">document tree</a> to be laid out in a new
page box.
<h3><a name="page-break-props">Break before/after elements</a>: <span
class="propinst-page-break-before">'page-break-before'</span> and
<span class="propinst-page-break-after">'page-break-after'</span>
</h3>
<!-- #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>(For rendering to left and right sheets.)
Force one or two page breaks before
(after) the generated box
so that the next page is formated as a left page.</dd>
<dt><strong>right</strong></dt>
<dd>(For rendering to left and right sheets.)
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> A potential page break location is typically under the influence
of the 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'. See the section on <a
href="#allowed-page-breaks">allowed page breaks</a> for the exact
rules on how these properties may force or suppress a page break.
<h3><a name="named-pages">Using named pages:</a> <span class="propinst-page">'page'</span></h3>
<!-- #include src=properties/page.srb -->
<p>The <span class="propinst-page">'page'</span> property can
be used to specify a particular type of page where an element should
be displayed.
<P>By adding ':left' or ':right' the element can be forced to fall on
a left or right page as well.
<div class="example">
<p>This example will put all tables on a right-hand side landscape
page (named "rotated"):</P>
<pre>
@page rotated {size: landscape}
TABLE {page: rotated:right}
</pre>
</div>
<p>The <span class="propinst-page">'page'</span> property works as
follows: If a block box with inline content has a <span
class="propinst-page">'page'</span> property that is different from
the preceding block box with inline content, then one or two
page breaks are inserted between them, and the boxes after the break
are rendered onto a page box of the named type.
<div class="example">
<p>In this example, the two tables are rendered on landscape pages
(indeed, on the same page, if they fit), and the page type "narrow" is
not used at all, despite having been set on the DIV:</p>
<pre>
@page narrow {size: 9cm 18cm}
@page rotated {size: landscape}
DIV {page: narrow}
TABLE {page: rotated}
</pre>
<p>with this document::
<pre>
<DIV>
<TABLE>...</TABLE>
<TABLE>...</TABLE>
</DIV>
</pre>
</div>
<h3><a name="break-inside">Breaks inside elements</a>: <span
class="propinst-orphans">'orphans'</span>, <span
class="propinst-widows">'widows'</span>, and <span
class="propinst-page-break-inside">'page-break-inside'</span></h3>
<!-- #include src=properties/orphans.srb -->
<!-- #include src=properties/widows.srb -->
<P>The <span class="propinst-orphans">'orphans'</span> property
specifies the minimum number of lines of a paragraph that must be left
at the bottom of a page. The <span
class="propinst-widows">'widows'</span> property specifies the minimum
number of lines of a paragraph that must be left at the top of a page.
Examples of how they are used to control page breaks are given below.
<p>The <span
class="propinst-page-break-inside">'page-break-inside'</span> property
can be used to turn off page breaking inside an element completely,
i.e., keep the whole element on one page. The 'widows' and 'orphans'
properties are not used if <span
class="propinst-page-break-inside">'page-break-inside'</span> is
'avoid'. However, if the element is larger than the page, so that it
<em>has</em> to be broken, then the <span
class="propinst-page-break-inside">'page-break-inside'</span> property
is ignored (treated as if it were 'auto') and page breaks are
determined using the 'widows' and 'orphans' properties.
<P>For information about paragraph formatting, please consult the
section on <a href="visuren.html#line-box">line boxes</a>.
<h3><a name="allowed-page-breaks">Allowed page breaks</a></h3>
<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:
<ol style="list-style-type: upper-alpha">
<li>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>However, if the nearest common ancestor of all the elements
meeting at this margin has a <span
class="propinst-page-break-inside">'page-break-inside'</span> value
of 'avoid', then breaking here is not allowed.
<li>
<p>Breaking at (2) is allowed only if the number of <a
href="visuren.html#line-box">line boxes</a> between the
break and the start of the enclosing block box is <span
class="propinst-orphans">'orphans'</span> or more, and the number of
line boxes between the break and the end of the box is <span
class="propinst-widows">'widows'</span> or more.
<li>In addition, breaking at (2) is allowed only if the <span
class="propinst-page-break-inside">'page-break-inside'</span> property
is 'auto'.
</ol>
<p>If the above doesn't provide enough break points to keep content
from overflowing the page boxes, then rules B and D are dropped in
order to find additional breakpoints.
<p>If that still does not lead to sufficient break points, rules A and
C are dropped as well, to find still more break points.
<P>Page breaks cannot occur inside boxes that are <a
href="visuren.html#absolute-positioning">absolutely-positioned</a>.
<!-- What about relative positioning? -IJ -->
<h3>Forced page breaks</h3>
<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'.
<p>A page break must also occur at (1) if the last line box above this
margin and the first one below it do not have the same value for <span
class="propinst-page">'page'</span>.
<h3>"Best" page breaks</h3>
<p>CSS2 does <em>not</em> define which of a set of allowed page breaks
must be used; CSS2 does not forbid a user agent from breaking at every
possible break point, or not to break at all. But CSS2 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 floating element
</ul>
<div class="example"><P>
Suppose, for example, that the style sheet
contains 'orphans : 4', 'widows : 2', and
there are 20 lines (<a href="visuren.html#line-box">line boxes</a>)
available at the bottom of the current page:</p>
<ul>
<li>If a paragraph at the end of the current page contains 20 lines or fewer,
it should be placed on the current page.
<li>If the paragraph contains 21 or 22 lines, the second part of the
paragraph must not violate the <span
class="propinst-widows">'widows'</span> constraint, and so the
second part must contain exactly two lines
<li>If the paragraph contains 23 lines or more, the first part should
contain 20 lines and the second part the remaining lines.
</ul>
<P>Now suppose that <span class="propinst-orphans">'orphans'</span> is
'10',
<span class="propinst-widows">'widows'</span> is '20',
and there are 8 lines available at the bottom of the current page:</p>
<ul>
<li>If a paragraph at the end of the current page contains 8 lines or
fewer, it should be placed on the current page.
<li>If the paragraph contains 9 lines or more, it cannot be split
(that would violate the orphan constraint), so it should move
as a block to the next page.
</ul>
</div>
<h2>Cascading in the page context</H2>
<P>Declarations in the <a href="#page-context">page context</a> obey
the <a href="cascade.html">cascade</a> just like normal CSS2
declarations.
<div class="example"><P>
Consider the following example:
<PRE>
@page {
margin-left: 3cm;
}
@page :left {
margin-left: 4cm;
}
</PRE>
<P>Due to the <a href="cascade.html#cascading-order">higher
specificity</a> of the pseudo-class selector, the left margin on left
pages will be '4cm' and all other pages (i.e., the right pages) will
have a left margin of '3cm'.
</div>
</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:
-->