-
Notifications
You must be signed in to change notification settings - Fork 791
Expand file tree
/
Copy pathOverview.html
More file actions
1801 lines (1366 loc) · 68.9 KB
/
Overview.html
File metadata and controls
1801 lines (1366 loc) · 68.9 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
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang=en>
<head
profile="http://dublincore.org/documents/2008/08/04/dc-html/ http://www.w3.org/2006/03/hcard">
<meta content="text/html; charset=utf-8" http-equiv=Content-Type>
<title>CSS Fragmentation Module Level 3</title>
<link href="http://purl.org/dc/terms/" rel=schema.dcterms>
<link href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
rel=dcterms.rights>
<meta content="CSS Fragmentation Module Level 3" name=dcterms.title>
<meta content=text name=dcterms.type>
<meta content=2013-02-11 name=dcterms.issued>
<meta content="http://dev.w3.org/csswg/css3-break/" name=dcterms.creator>
<meta content=W3C name=dcterms.publisher>
<meta content="http://www.w3.org/TR/2013/ED-css3-break-20130211/"
name=dcterms.identifier>
<link href="../default.css" rel=stylesheet type="text/css">
<link href="http://www.w3.org/StyleSheets/TR/W3C-ED.css" rel=stylesheet
type="text/css">
<body>
<div class=head> <!--begin-logo-->
<p><a href="http://www.w3.org/"><img alt=W3C height=48
src="http://www.w3.org/Icons/w3c_home" width=72></a> <!--end-logo-->
<h1 id=css-fragmentation-module>CSS Fragmentation Module Level 3</h1>
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 11 February
2013</h2>
<dl>
<dt>This version:</dt>
<!--<dd><a href="http://www.w3.org/TR/2013/ED-css3-break-20130211/">http://www.w3.org/TR/2013/WD-css3-break-20130211/</a></dd>-->
<dd><a
href="http://dev.w3.org/csswg/css3-break/">http://dev.w3.org/csswg/css3-break/</a>
<dt>Latest version:
<dd><a
href="http://www.w3.org/TR/css3-break/">http://www.w3.org/TR/css3-break/</a>
<dt>Editor's Draft:
<dd><a
href="http://dev.w3.org/csswg/css3-break/">http://dev.w3.org/csswg/css3-break/</a>
<dt>Previous version:
<dd><a
href="http://www.w3.org/TR/2012/WD-css3-break-20120228/">http://www.w3.org/TR/2012/WD-css3-break-20120228/</a>
<dt>Editors:
<dd class=vcard><span class=fn>Rossen Atanassov</span>, <span
class=org><a class="fn org url"
href="http://www.microsoft.com/">Microsoft Corporation</a></span>, <span
class=email>ratan@microsoft.com</span>
<dd class=vcard><span class=fn><a class=fn
href="http://fantasai.inkedblade.net/contact">Elika J.
Etemad</a></span>, <span class=org><a class="fn org url"
href="http://www.mozilla.org/">Mozilla Corporation</a></span>
<dt>Issues List:
<dd><a
href="http://wiki.csswg.org/spec/css3-break">http://wiki.csswg.org/spec/css3-break</a>
<dt>Feedback:</dt>
<dd><a href="mailto:www-style@w3.org?subject=%5Bcss-break%5D%20feedback"
>www-style@w3.org</a>
with subject line “<kbd>[css-break]
<var>… message topic …</var></kbd>”
(<a rel="discussion" href="http://lists.w3.org/Archives/Public/www-style/"
>archives</a>)
</dl>
<!--begin-copyright-->
<p class=copyright><a
href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
rel=license>Copyright</a> © 2013 <a href="http://www.w3.org/"><abbr
title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a
href="http://www.csail.mit.edu/"><abbr
title="Massachusetts Institute of Technology">MIT</abbr></a>, <a
href="http://www.ercim.eu/"><abbr
title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>,
<a href="http://www.keio.ac.jp/">Keio</a>, <a
href="http://ev.buaa.edu.cn/">Beihang</a>), All Rights Reserved. W3C <a
href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
<a
href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
and <a
href="http://www.w3.org/Consortium/Legal/copyright-documents">document
use</a> rules apply.</p>
<!--end-copyright-->
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc" id=abstract> Abstract</h2>
<p> This module describes the fragmentation model that partitions a flow
into pages. It builds on the Page model module and introduces and defines
the fragmentation model. It adds functionality for pagination, breaking
variable fragment size and orientation, widows and orphans.
<h2 class="no-num no-toc" id=status> Status of this document</h2>
<!--begin-status-->
<p>This is a public copy of the editors' draft. It is provided for
discussion only and may change at any moment. Its publication here does
not imply endorsement of its contents by W3C. Don't cite this document
other than as work in progress.
<p>The (<a
href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public
mailing list <a
href="mailto:www-style@w3.org?Subject=%5Bcss3-break%5D%20PUT%20SUBJECT%20HERE">
www-style@w3.org</a> (see <a
href="http://www.w3.org/Mail/Request">instructions</a>) is preferred for
discussion of this specification. When sending e-mail, please put the text
“css3-break” in the subject, preferably like this:
“[<!---->css3-break<!---->] <em>…summary of comment…</em>”
<p>This document was produced by the <a href="/Style/CSS/members">CSS
Working Group</a> (part of the <a href="/Style/">Style Activity</a>).
<p>This document was produced by a group operating under the <a
href="/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent
Policy</a>. W3C maintains a <a href="/2004/01/pp-impl/32061/status"
rel=disclosure>public list of any patent disclosures</a> made in
connection with the deliverables of the group; that page also includes
instructions for disclosing a patent. An individual who has actual
knowledge of a patent which the individual believes contains <a
href="/Consortium/Patent-Policy-20040205/#def-essential">Essential
Claim(s)</a> must disclose the information in accordance with <a
href="/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the
W3C Patent Policy</a>.</p>
<!--end-status-->
<!--<p>The following features are at risk: …</p>-->
<h2 class="no-num no-toc" id=contents> Table of contents</h2>
<!--begin-toc-->
<ul class=toc>
<li><a href="#intro"><span class=secno>1. </span> Introduction</a>
<ul class=toc>
<li><a href="#placement"><span class=secno>1.1. </span> Module
Interactions</a>
<li><a href="#values"><span class=secno>1.2. </span> Values</a>
</ul>
<li><a href="#fragmentation-model"><span class=secno>2. </span>
Fragmentation Model and Terminology</a>
<li><a href="#breaking-controls"><span class=secno>3. </span> Controlling
Breaks</a>
<ul class=toc>
<li><a href="#break-between"><span class=secno>3.1. </span> Breaks
Between Boxes: the ‘<code class=property>break-before</code>’ and
‘<code class=property>break-after</code>’ properties</a>
<ul class=toc>
<li class=no-num><a href="#generic-break-values"> Generic Break
Values</a>
<li class=no-num><a href="#page-break-values"> Page Break Values</a>
<li class=no-num><a href="#column-break-values"> Column Break
Values</a>
<li class=no-num><a href="#region-break-values"> Region Break
Values</a>
</ul>
<li><a href="#break-within"><span class=secno>3.2. </span> Breaks Within
Boxes: the ‘<code class=property>break-inside</code>’ property</a>
<li><a href="#widows-orphans"><span class=secno>3.3. </span> Breaks
Between Lines: ‘<code class=property>orphans</code>’, ‘<code
class=property>widows</code>’</a>
<li><a href="#page-break-properties"><span class=secno>3.4. </span> Page
Break Aliases: the ‘<code class=property>page-break-before</code>’,
‘<code class=property>page-break-after</code>’, and ‘<code
class=property>page-break-inside</code>’ properties</a>
</ul>
<li><a href="#breaking-rules"><span class=secno>4. </span> Rules for
Breaking</a>
<ul class=toc>
<li><a href="#possible-breaks"><span class=secno>4.1. </span> Possible
Break Points</a>
<li><a href="#break-types"><span class=secno>4.2. </span> Types of
Breaks</a>
<li><a href="#forced-breaks"><span class=secno>4.3. </span> Forced
breaks</a>
<li><a href="#unforced-breaks"><span class=secno>4.4. </span> Unforced
Breaks</a>
<li><a href="#best-breaks"><span class=secno>4.5. </span> Optimizing
Unforced Breaks</a>
</ul>
<li><a href="#breaking-boxes"><span class=secno>5. </span> Box Model for
Breaking</a>
<ul class=toc>
<li><a href="#varying-size-boxes"><span class=secno>5.1. </span>
Breaking into Varying-size Fragmentainers</a>
<li><a href="#break-margins"><span class=secno>5.2. </span> Margins at
Breaks</a>
<li><a href="#break-decoration"><span class=secno>5.3. </span> Splitting
Boxes at Breaks</a>
<li><a href="#transforms"><span class=secno>5.4. </span> Transforms,
Positioning, and Pagination</a>
</ul>
<li><a href="#conformance"><span class=secno>6. </span> Conformance</a>
<ul class=toc>
<li><a href="#conventions"><span class=secno>6.1. </span> Document
Conventions</a>
<li><a href="#conformance-classes"><span class=secno>6.2.
</span>Conformance Classes</a>
<li><a href="#partial"><span class=secno>6.3. </span> Partial
Implementations</a>
<li><a href="#experimental"><span class=secno>6.4. </span> Experimental
Implementations</a>
<li><a href="#testing"><span class=secno>6.5. </span> Non-Experimental
Implementations</a>
<li><a href="#cr-exit-criteria"><span class=secno>6.6. </span> CR Exit
Criteria</a>
</ul>
<li class=no-num><a href="#changes"> Changes</a>
<li class=no-num><a href="#acknowledgments"> Acknowledgments</a>
<li class=no-num><a href="#references">References</a>
<ul class=toc>
<li class=no-num><a href="#normative-references">Normative
references</a>
<li class=no-num><a href="#other-references">Other references</a>
</ul>
<li class=no-num><a href="#index">Index</a>
<li class=no-num><a href="#property-index">Property index</a>
</ul>
<!--end-toc-->
<h2 id=intro><span class=secno>1. </span> Introduction</h2>
<p><em>This section is not normative.</em>
<p> In paged media (e.g., paper, transparencies, photo album pages, pages
displayed on computer screens as printed output simulations), as opposed
to <a href="http://www.w3.org/TR/CSS2/media.html#continuous-media-group">
continuous media</a>, the content of the document is split into one or
more discrete display surfaces. In order to avoid awkward breaks (such as
halfway through a line of text), the layout engine must be able to shift
around content that would fall across the page break. This process is
called <dfn id=pagination>pagination</dfn>.
<p> In CSS, in addition to paged media, certain layout features such as <a
href="http://www.w3.org/TR/css3-regions/">regions</a> <a
href="#CSS3-REGIONS"
rel=biblioentry>[CSS3-REGIONS]<!--{{CSS3-REGIONS}}--></a> and <a
href="http://www.w3.org/TR/css3-multicol/">multi-column layout</a> <a
href="#CSS3COL" rel=biblioentry>[CSS3COL]<!--{{CSS3COL}}--></a> create a
similarly fragmented environment. The generic term for breaking content
across containers is <dfn id=fragmentation>fragmentation</dfn>. This
module explains how content breaks across <a
href="#fragmentation-container"><i>fragmentation containers</i></a> (<a
href="#fragmentainer"><i>fragmentainers</i></a>) such as pages and columns
and how such breaks can be <a href="#breaking-controls">controlled by the
author</a>.
<h3 id=placement><span class=secno>1.1. </span> Module Interactions</h3>
<p> This module replaces and extends the pagination controls defined in <a
href="#CSS21" rel=biblioentry>[CSS21]<!--{{CSS21}}--></a> <a
href="http://www.w3.org/TR/CSS21/page.html#page-breaks">section 13.3</a>
and in <a href="#CSS3PAGE"
rel=biblioentry>[CSS3PAGE]<!--{{CSS3PAGE}}--></a>.</p>
<!-- End section "Modules Interactions" -->
<h3 id=values><span class=secno>1.2. </span> Values</h3>
<p> This specification follows the <a
href="http://www.w3.org/TR/CSS21/about.html#property-defs"> CSS property
definition conventions</a> from <a href="#CSS21"
rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>. Value types not defined in
this specification are defined in CSS Level 2 Revision 1 <a href="#CSS21"
rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>. Other CSS modules may expand
the definitions of these value types: for example [[CSS3VALUE]], when
combined with this module, adds the ‘<code class=css>initial</code>’
value to the properties defined here.
<p> In addition to the property-specific values listed in their
definitions, all properties defined in this specification also accept the
<a href="http://www.w3.org/TR/CSS21/cascade.html#value-def-inherit">
inherit</a> keyword as their property value. For readability it has not
been repeated explicitly.
<h2 id=fragmentation-model><span class=secno>2. </span> Fragmentation Model
and Terminology</h2>
<dl>
<dt><dfn id=fragmentation-container>fragmentation container</dfn> (<dfn
id=fragmentainer>fragmentainer</dfn>)
<dd> A box—such as a page box, column box, or region—that contains a
portion (or all) of a <a href="#fragmented-flow"><i>fragmented
flow</i></a>. Fragmentainers can be pre-defined, or generated as needed.
When breakable content overflows a fragmentainer in the block dimension,
instead of overflowing it breaks into the next container in its <a
href="#fragmentation-context"><i>fragmentation context</i></a>.
<dt><dfn id=fragmentation-context>fragmentation context</dfn>
<dd> An ordered series of <a
href="#fragmentainer"><i>fragmentainers</i></a>, such as created by a <a
href="http://www.w3.org/TR/css3-multicol/">multi-column element</a>, a
chain of <a href="http://www.w3.org/TR/css3-regions">CSS regions</a>, or
a <a href="http://www.w3.org/TR/css3-page/">paged media display</a>. A
given fragmentation context can only have one block flow direction across
all its <a href="#fragmentainer"><i>fragmentainers</i></a>.
<dt><dfn id=fragmented-flow>fragmented flow</dfn>
<dd> A content flow that is being laid out in a <a
href="#fragmentation-context"><i>fragmentation context</i></a>. The <a
href="#fragmented-flow"><i>fragmented flow</i></a> consists of the
content of a (possibly anonymous) box called the <dfn
id=fragmenation-root>fragmenation root</dfn>.
<dt><dfn id=fragmentation-direction>fragmentation direction</dfn>
<dd> The block flow direction of the <a
href="#fragmentation-context"><i>fragmentation context</i></a>, i.e. the
direction in which content is fragmented. (In this level of CSS, content
only fragments in one dimension.)
<dt><dfn id=fragmentation0>fragmentation</dfn>
<dd> The process of splitting a content flow across the <a
href="#fragmentainer"><i>fragmentainers</i></a> that form a <a
href="#fragmentation-context"><i>fragmentation context</i></a>.
<dt><dfn id=box-fragment>box fragment</dfn> or <dfn
id=fragment>fragment</dfn>
<dd> The portion of a box that belongs to exactly one <a
href="#fragmentainer"><i>fragmentainer</i></a>. A box in continuous flow
always consists of only one fragment. A box in a fragmented flow consists
of one or more fragments.
<dt><dfn id=remaining-fragmentainer-extent>remaining fragmentainer
extent</dfn>
<dd> The remaining extent in the <a
href="#fragmentainer"><i>fragmentainer</i></a> available to a given
element, i.e. between the end of preceding content in <a
href="#fragmentainer"><i>fragmentainer</i></a> and the edge of the <a
href="#fragmentainer"><i>fragmentainer</i></a>.
</dl>
<p> Each <dfn id=fragmentation-break>fragmentation break</dfn> (hereafter,
<dfn id=break>break</dfn>) ends layout of the fragmented box in the
current <a href="#fragmentainer"><i>fragmentainer</i></a> and causes the
remaining content to be laid out in the next <a
href="#fragmentainer"><i>fragmentainer</i></a>, in some cases causing a
new <a href="#fragmentainer"><i>fragmentainer</i></a> to be generated to
hold the deferred content. When multiple flows are laid out in parallel,
fragmentation is performed independently in each flow.
<p> Breaking a <i>fragmentainer <var>F</var> effectively splits the <a
href="#fragmentainer"><i>fragmentainer</i></a> into two <a
href="#fragmentainer"><i>fragmentainers</i></a> (<var>F<sub>1</sub></var>
and <var>F<sub>2</sub></var>). The only difference is that the type of
break between the two pieces <var>F<sub>1</sub></var> and
<var>F<sub>2</sub></var> is the <a href="#break-types">type of break</a>
created by the <a href="#fragmentation-context"><i>fragmentation
context</i></a> that split <var>F</var>, not the type of break normally
created by <var>F</var>‘<code class=css>s own <a
href="#fragmentation-context"><i>fragmentation context</i></a>.
</code></i>
<p class=note> Breaking inline content into lines is another form of
fragmentation, and similarly creates box fragments when it breaks <a
href="http://www.w3.org/TR/CSS21/visuren.html#inline-boxes">inline
boxes</a> across <a
href="http://www.w3.org/TR/CSS21/visuren.html#line-box">line boxes</a>.
However, inline breaking is not covered here; see <a href="#CSS3TEXT"
rel=biblioentry>[CSS3TEXT]<!--{{CSS3TEXT}}--></a> and the
’box-decoration-break' property in <a href="#CSS3BG"
rel=biblioentry>[CSS3BG]<!--{{CSS3BG}}--></a>.
<h2 id=breaking-controls><span class=secno>3. </span> Controlling Breaks</h2>
<p> The following sections explain how breaks are controlled in a <a
href="#fragmented-flow"><i>fragmented flow</i></a>. A page/column/region
break opportunity between boxes is under the influence of the containing
block's ‘<a href="#break-inside"><code
class=property>break-inside</code></a>’ property, the ‘<a
href="#break-after"><code class=property>break-after</code></a>’
property of the preceding element, and the ‘<a
href="#break-before"><code class=property>break-before</code></a>’
property of the following element. A page/column/region break opportunity
between line boxes is under the influence of the containing block's ‘<a
href="#break-inside"><code class=property>break-inside</code></a>’,
‘<a href="#widows"><code class=property>widows</code></a>’, and ‘<a
href="#orphans"><code class=property>orphans</code></a>’ properties. A
fragmentation break can be allowed, forced, or discouraged depending on
the values of these properties. In the case of forced page breaks, the
author can also specify on which page (<a
href="http://www.w3.org/TR/css3-page/#left-right-first">left or right</a>)
the subsequent content should resume.
<p> See the section on <a href="#breaking-rules">rules for breaking</a> for
the exact rules on how these properties affect fragmentation.
<h3 id=break-between><span class=secno>3.1. </span> Breaks Between Boxes:
the ‘<a href="#break-before"><code
class=property>break-before</code></a>’ and ‘<a
href="#break-after"><code class=property>break-after</code></a>’
properties</h3>
<table class=propdef summary="property definition">
<tbody>
<tr>
<th>Name:
<td><dfn id=break-before>break-before</dfn>, <dfn
id=break-after>break-after</dfn>
<tr>
<th>Value:
<td>auto | avoid | always | any | avoid-page | page | left | right |
recto | verso | avoid-column | column | avoid-region | region
<tr>
<th>Initial:
<td>auto
<tr>
<th>Applies to:
<td>block-level elements, table row groups, table rows (but see prose)
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>specified value
</table>
<p> These properties specify page/column/region break behavior before/after
the generated box. The <dfn id=forced-break-values>forced break
values</dfn> ‘<code class=css>always</code>’, ‘<code
class=css>any</code>’, ‘<code class=css>left</code>’, ‘<code
class=css>right</code>’, ‘<code class=css>recto</code>’, ‘<code
class=css>verso</code>’, ‘<code class=css>page</code>’, ‘<code
class=css>column</code>’ and ‘<code class=css>region</code>’ create
a <a href="#forced-breaks">forced break</a> in the flow while the <dfn
id=avoid-break-values>avoid break values</dfn> ‘<code
class=css>avoid</code>’, ‘<code class=css>avoid-page</code>’,
‘<code class=css>avoid-column</code>’ and ‘<code
class=css>avoid-region</code>’ indicate that content should be kept
together.
<p> User Agents must apply these properties to boxes in the normal flow of
the <i>fragmentation root</i>. User agents should also apply these
properties to floated boxes whose containing block is in the normal flow
of the root fragmented element. User agents may also apply these
properties to other boxes.
<p> Values are defined in the sections below.
<h4 class=no-num id=generic-break-values> Generic Break Values</h4>
<p> These values have an effect regardless of the type of fragmented
context containing the flow.
<dl>
<dt>‘<code class=css>auto</code>’
<dd> Neither force nor forbid a break before/after the principle box.
<dt>‘<code class=css>avoid</code>’
<dd> Avoid a break before/after the principle box.
<dt>‘<code class=css>always</code>’
<dd> Always force a break (of all possible types, through all
fragmentation contexts) before/after the principle box.
<dt>‘<code class=css>any</code>’
<dd> Force a break of any type, whichever is the type of the deepest
fragmentation context, before/after the principle box.
</dl>
<h4 class=no-num id=page-break-values> Page Break Values</h4>
<p> These values only have an effect in paginated contexts; if the flow is
not paginated, they have no effect.
<dl>
<dt>‘<code class=css>avoid-page</code>’
<dd> Avoid a page break before/after the principle box.
<dt>‘<code class=css>page</code>’
<dd> Always force a page break before/after the principle box.
<dt>‘<code class=css>left</code>’
<dd> Force one or two page breaks before/after the principle box so that
the next page is formatted as a left page.
<dt>‘<code class=css>right</code>’
<dd> Force one or two page breaks before/after the principle box so that
the next page is formatted as a right page.
<dt>‘<code class=css>recto</code>’
<dd> Force one or two page breaks before/after the principal box so that
the next page is formatted as either a left page or a right page,
whichever is second (according to the page progression) in a page spread.
<dt>‘<code class=css>verso</code>’
<dd> Force one or two page breaks before/after the principal box so that
the next page is formatted as either a left page or a right page,
whichever is first (according to the page progression) in a page spread.
</dl>
<h4 class=no-num id=column-break-values> Column Break Values</h4>
<p> These values only have an effect in multi-column contexts; if the flow
is not within a multi-column context, they have no effect.
<dl>
<dt>‘<code class=css>avoid-column</code>’
<dd> Avoid a column break before/after the principle box.
<dt>‘<code class=css>column</code>’
<dd> Always force a column break before/after the principle box.
</dl>
<h4 class=no-num id=region-break-values> Region Break Values</h4>
<p> These values only have an effect in multi-region contexts; if the flow
is not linked across multiple regions, these values have no effect.
<dl>
<dt>‘<code class=css>avoid-region</code>’
<dd> Avoid a region break before/after the principle box.
<dt>‘<code class=css>region</code>’
<dd> Always force a region break before/after the principle box.
</dl>
<h3 id=break-within><span class=secno>3.2. </span> Breaks Within Boxes: the
‘<a href="#break-inside"><code class=property>break-inside</code></a>’
property</h3>
<table class=propdef summary="property definition">
<tbody>
<tr>
<th>Name:
<td><dfn id=break-inside>break-inside</dfn>
<tr>
<th>Value:
<td>auto | avoid | avoid-page | avoid-column | avoid-region
<tr>
<th>Initial:
<td>auto
<tr>
<th>Applies to:
<td>elements in the normal flow that that establish formatting contexts,
or are block containers, table row groups, or table rows
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>specified value
</table>
<p> This property specifies page/column/region break behavior within the
generated box. Values have the following meanings:
<dl>
<dt>‘<code class=css>auto</code>’
<dd> Impose no additional breaking constraints within the box.
<dt>‘<code class=css>avoid</code>’
<dd> Avoid breaks within the box.
<dt>‘<code class=css>avoid-page</code>’
<dd> Avoid a page break within the box.
<dt>‘<code class=css>avoid-column</code>’
<dd> Avoid a column break within the box.
<dt>‘<code class=css>avoid-region</code>’
<dd> Avoid a region break within the box.
</dl>
<h3 id=widows-orphans><span class=secno>3.3. </span> Breaks Between Lines:
‘<a href="#orphans"><code class=property>orphans</code></a>’, ‘<a
href="#widows"><code class=property>widows</code></a>’</h3>
<table class=propdef summary="property definition">
<tbody>
<tr>
<th>Name:
<td><dfn id=orphans>orphans</dfn>, <dfn id=widows>widows</dfn>
<tr>
<th>Value:
<td><integer>
<tr>
<th>Initial:
<td>2
<tr>
<th>Applies to:
<td>block containers
<tr>
<th>Inherited:
<td>yes
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>specified value
</table>
<p> The ‘<a href="#orphans"><code class=property>orphans</code></a>’
property specifies the minimum number of line boxes in a block container
that must be left in a <a href="#fragment"><i>fragment</i></a> before a
fragment break. The ‘<a href="#widows"><code
class=property>widows</code></a>’ property specifies the minimum number
of line boxes of a block container that must be left in a <a
href="#fragment"><i>fragment</i></a> after a break. Examples of how they
are used to control fragmentation breaks are given <a
href="#widows-orphans-example">below</a>.
<p> Only positive integers are allowed as values of ‘<a
href="#orphans"><code class=property>orphans</code></a>’ and ‘<a
href="#widows"><code class=property>widows</code></a>’. Negative values
and zero are invalid must cause the declaration to be <a
href="http://www.w3.org/TR/CSS21/conform.html#ignore">ignored</a>.
<p> If a block contains fewer lines than the value of ‘<a
href="#widows"><code class=property>widows</code></a>’ or ‘<a
href="#orphans"><code class=property>orphans</code></a>’, the rule
simply becomes that all lines in the block must be kept together.
<h3 id=page-break-properties><span class=secno>3.4. </span> Page Break
Aliases: the ‘<code class=property>page-break-before</code>’, ‘<code
class=property>page-break-after</code>’, and ‘<code
class=property>page-break-inside</code>’ properties</h3>
<p>For compatibility with <a
href="http://www.w3.org/TR/CSS21/page.html">CSS Level 2</a>, UAs that
conform to <a href="#CSS21" rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>
must alias the ‘<code class=property>page-break-before</code>’,
‘<code class=property>page-break-after</code>’, and ‘<code
class=property>page-break-inside</code>’ properties to ‘<a
href="#break-before"><code class=property>break-before</code></a>’,
‘<a href="#break-after"><code class=property>break-after</code></a>’,
and ‘<a href="#break-inside"><code
class=property>break-inside</code></a>’ by treating the ‘<code
class=css>page-break-*</code>’ properties as shorthands for the ‘<code
class=css>break-*</code>’ properties with the following value mappings:
<table class=data>
<thead>
<tr>
<th>Shorthand (‘<code class=css>page-break-*</code>’) Values
<th>Longhand (‘<code class=css>break-*</code>’) Values
<tbody>
<tr>
<td>‘<code class=css>auto | left | right | avoid</code>’
<td>‘<code class=css>auto | left | right | avoid</code>’
<tr>
<td>‘<code class=css>always</code>’
<td>‘<code class=css>page</code>’
</table>
<h2 id=breaking-rules><span class=secno>4. </span> Rules for Breaking</h2>
<p> A fragmented flow may be broken across fragmentainers at a number of <a
href="#possible-breaks">possible break points</a>. In the case of <a
href="#forced-breaks">forced breaks</a>, the UA is required to break the
flow at that point. In the case of <a href="#unforced-breaks">unforced
breaks</a> the UA has to choose among the possible breaks that are
allowed.
<p> Some content is not fragmentable. For example many types of <a
href="http://www.w3.org/TR/CSS21/conform.html#replaced-element">replaced
elements</a> <a href="#CSS21" rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>
(such as images or video), scrollable elements, or a single line of text
content. Such content is considered <dfn id=monolithic>monolithic</dfn>:
it contains no possible break points. In addition to any content which is
not fragmentable, UAs may consider as <a
href="#monolithic"><i>monolithic</i></a> any elements with ‘<code
class=property>overflow</code>’ set to ‘<code class=css>auto</code>’
or ‘<code class=css>scroll</code>’ and any elements with ‘<code
class=css>overflow: hidden</code>’ and a non-‘<code
class=css>auto</code>’ <a
href="http://www.w3.org/TR/css3-writing-modes/#extent">logical height</a>
(and no specified maximum logical height).
<h3 id=possible-breaks><span class=secno>4.1. </span> Possible Break Points</h3>
<p> Fragmentation splits boxes in the block flow dimension. In
block-and-inline flow, breaks may occur at the following places:
<dl>
<dt id=btw-blocks>Class 1
<dd> Between sibling boxes of the following types:
<dl>
<dt>Block-parallel Fragmentation
<dd> When the block flow direction of the siblings' containing block is
parallel to that of the fragmentation context: block-level boxes, table
row group boxes, table row boxes, multi-column column row boxes
<dt>Block-perpendicular Fragmentation
<dd> When the block flow direction of the siblings' containing block is
perpendicular to that of the fragmentation context: table column group
boxes, table column boxes, multi-column column boxes
</dl>
<dt id=btw-lines>Class 2
<dd> Between line boxes inside a block container box.
<dt id=end-block>Class 3
<dd> Between the content edge of a block container box and the outer edges
of its child content (margin edges of block-level children or line box
edges for inline-level children) <em>if</em> there is a (non-zero) gap
between them.
</dl>
<p class=note> Other layout models may add breakpoints to the above
classes.
<p> Since breaks are only allowed between siblings (1), not between a box
and its container, a ‘<a href="#break-before"><code
class=property>break-before</code></a>’ value on a first-child box is
propagated to its container. Likewise a ‘<a href="#break-after"><code
class=property>break-after</code></a>’ value on a last-child box is
propagated to its container.
<p id=monolithic-breaking> The UA is not required to fragment the contents
of <a href="#monolithic"><i>monolithic</i></a> elements, and may instead
either slice the element's graphical representation as necessary to
fragment it or treat its box as unbreakable and overflow the
fragmentainer. In both cases it must treat the element as having ‘<code
class=css>break-inside: avoid</code>’, i.e. only slice or overflow at
the fragmentainer edge if there are no <a href="#possible-breaks">possible
break points</a> on the fragmentainer.
<p> When paginating, if there are no possible break points below the top of
the page, and not all the content fits, the UA may break anywhere in order
to avoid losing content off the edge of the page.
<h3 id=break-types><span class=secno>4.2. </span> Types of Breaks</h3>
<p> There are different types of breaks in CSS, defined based on the type
of fragmentainers they span:
<dl>
<dt><dfn id=page-break>page break</dfn>
<dd> A break between two <a
href="http://www.w3.org/TR/css3-page/#page-box">page boxes</a>. <a
href="#CSS3PAGE" rel=biblioentry>[CSS3PAGE]<!--{{!CSS3PAGE}}--></a>
<dt><dfn id=spread-break>spread break</dfn>
<dd> A break between two page boxes that are not associated with <a
href="http://www.w3.org/TR/css3-page/#facing-pages">facing pages</a>. A
spread break is always also a page break. <a href="#CSS3PAGE"
rel=biblioentry>[CSS3PAGE]<!--{{!CSS3PAGE}}--></a>
<dt><dfn id=column-break>column break</dfn>
<dd> A break between two <a
href="http://www.w3.org/TR/css3-multicol/#column-box">column boxes</a>.
Note that if the column boxes are on different pages, then the break is
also a <a href="#page-break"><i>page break</i></a>. Similarly, if the
column boxes are in different regions, then the break is also a <a
href="#region-break"><i>region break</i></a>. <a href="#CSS3COL"
rel=biblioentry>[CSS3COL]<!--{{!CSS3COL}}--></a>
<dt><dfn id=region-break>region break</dfn>
<dd> A break between two <a
href="http://www.w3.org/TR/css3-regions/#regions">regions</a>. Note that
if the region boxes are on different pages, then the break is also a <a
href="#page-break"><i>page break</i></a>. <a href="#CSS3-REGIONS"
rel=biblioentry>[CSS3-REGIONS]<!--{{!CSS3-REGIONS}}--></a>
</dl>
<p class=note> A fifth type of break is the <dfn id=line-break>line
break</dfn>, which is a break between two <a
href="http://www.w3.org/TR/CSS21/visuren.html#line-box">line boxes</a>.
These are not covered in this specification; see <a href="#CSS21"
rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>.
<h3 id=forced-breaks><span class=secno>4.3. </span> Forced breaks</h3>
<p> A forced break then occurs at <a href="#btw-blocks">(1)</a> if, among
the ‘<a href="#break-after"><code
class=property>break-after</code></a>’ properties specified on or
propagated to the earlier sibling box and the ‘<a
href="#break-before"><code class=property>break-before</code></a>’
properties specified on or propagated to the later sibling box there is at
least one with a <i>forced break value</i>.
<p> When multiple <a href="#forced-break-values"><i>forced break
values</i></a> apply to a single break point, they combine such all types
of break are honored and no content-empty page boxes are generated, except
for at most one content-empty page as may be required by the <a
href="#forced-break-values"><i>forced break values</i></a> to position
ensuing content on a specific type of page. When ‘<code
class=css>left</code>’, ‘<code class=css>right</code>’, ‘<code
class=css>recto</code>’, and/or ‘<code class=css>verso</code>’ are
combined, the value specified on the latest element in the flow wins.
<p class=note> A page break must also occur at <a
href="#btw-blocks">(1)</a> if the last line box above this margin and the
first one below it do not have the same value for ‘<code
class=property>page</code>’. See <a href="#CSS3PAGE"
rel=biblioentry>[CSS3PAGE]<!--{{!CSS3PAGE}}--></a>
<p> When a forced break occurs, it forces ensuing content into the next
fragmenter of the type associated with the break, breaking through as many
fragmentation contexts as necessary until the specified break types are
all satisfied. If the forced break is not contained within a matching type
of fragmentation context, then the forced break has no effect.
<h3 id=unforced-breaks><span class=secno>4.4. </span> Unforced Breaks</h3>
<p> While <a href="#breaking-controls">breaking controls</a> can force
breaks, they can also discourage them. The following rules control whether
breaking at a <a href="#possible-breaks">possible break point</a> is
allowed:
<dl>
<dt>Rule A
<dd> A fragmented flow may break at <a href="#btw-blocks">(1)</a> only if
all the ‘<a href="#break-after"><code
class=property>break-after</code></a>’ and ‘<a
href="#break-before"><code class=property>break-before</code></a>’
values applicable to this break point allow it, which is when at least
one of them forces a break or when all of them are ‘<code
class=css>auto</code>’.
<dt>Rule B
<dd> However, if all of them are ‘<code class=css>auto</code>’ and a
common ancestor of all the elements has a ‘<a
href="#break-inside"><code class=property>break-inside</code></a>’
value of ‘<code class=css>avoid</code>’, then breaking here is not
allowed.
<dt>Rule C
<dd> Breaking at <a href="#btw-lines">(2)</a> is allowed only if the
number of line boxes between the break and the start of the enclosing
block box is the value of ‘<a href="#orphans"><code
class=property>orphans</code></a>’ or more, and the number of line
boxes between the break and the end of the box is the value of ‘<a
href="#widows"><code class=property>widows</code></a>’ or more.
<dt>Rule D
<dd> Additionally, breaking at <a href="#btw-blocks">(2)</a> or <a
href="#end-block">(3)</a> is allowed only if the ‘<a
href="#break-inside"><code class=property>break-inside</code></a>’
property of all ancestors is ‘<code class=css>auto</code>’.
</dl>
<p> If the above doesn't provide enough break points to keep content from
overflowing the page boxes, then rules A, B and D are dropped in order to
find additional breakpoints. In this case the UA may use the ‘<code
class=css>avoid</code>’s that are in effect at those points to weigh the
appropriateness of the new breakpoints; however, this specification does
not suggest a precise algorithm.
<p> If that still does not lead to sufficient break points, rule C is
dropped as well, to find still more break points.
<h3 id=best-breaks><span class=secno>4.5. </span> Optimizing Unforced
Breaks</h3>
<p>While CSS3 requires that a fragmented flow must break at allowed break
points in order to avoid overflowing the fragmentainers in its
fragmentation context, it does not define whether content breaks at a
particular <a href="#unforced-breaks">allowed break</a>. However, it is
recommended that user agents observe the following guidelines (while
recognizing that they are sometimes contradictory):