8000 csswg-drafts/css-break/Overview.html at 07a13b5a35af34e839e99c38b9af81c2c9595d73 · w3c/csswg-drafts · GitHub
Skip to content

Latest commit

 

History

History
2392 lines (1655 loc) · 111 KB

File metadata and controls

2392 lines (1655 loc) · 111 KB
<!doctype html>
<html lang="en">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>CSS Fragmentation Module Level 3</title>
<meta content="refining" name="csswg-work-status">
<meta content="ED" name="w3c-status">
<link href="../default.css" rel="stylesheet" type="text/css">
<link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
<style>
body {
background: url("https://www.w3.org/StyleSheets/TR/logo-ED") top left no-repeat white;
background-attachment: fixed;
color: black;
font-family: sans-serif;
margin: 0 auto;
max-width: 50em;
padding: 2em 1em 2em 70px;
}
:link { color: #00C; background: transparent }
:visited { color: #609; background: transparent }
a[href]:active { color: #C00; background: transparent }
a[href]:hover { background: #ffa }
a[href] img { border-style: none }
h1, h2, h3, h4, h5, h6 { text-align: left }
h1, h2, h3 { color: #005A9C; }
h1 { font: 170% sans-serif }
h2 { font: 140% sans-serif }
h3 { font: 120% sans-serif }
h4 { font: bold 100% sans-serif }
h5 { font: italic 100% sans-serif }
h6 { font: small-caps 100% sans-serif }
.hide { display: none }
div.head { margin-bottom: 1em }
div.head h1 { margin-top: 2em; clear: both }
div.head table { margin-left: 2em; margin-top: 2em }
p.copyright { font-size: small }
p.copyright small { font-size: small }
pre { margin-left: 2em }
dt { font-weight: bold }
ul.toc, ol.toc {
list-style: none;
}
</style>
<meta content="Bikeshed 1.0.0" name="generator">
</head>
<body class="h-entry">
<div class="head">
<p data-fill-with="logo"><a class="logo" href="http://www.w3.org/">
<img alt="W3C" height="48" src="https://www.w3.org/Icons/w3c_home" width="72">
</a>
</p>
<h1 class="p-name no-ref" id="title">CSS Fragmentation Module Level 3</h1>
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft,
<time class="dt-updated" datetime="2015-07-20">20 July 2015</time></span></h2>
<div data-fill-with="spec-metadata">
<dl>
<dt>This version:
<dd><a class="u-url" href="http://dev.w3.org/csswg/css-break/">http://dev.w3.org/csswg/css-break/</a>
<dt>Latest version:
<dd><a href="http://www.w3.org/TR/css-break-3/">http://www.w3.org/TR/css-break-3/</a>
<dt>Previous Versions:
<dd><a href="http://www.w3.org/TR/2015/WD-css3-break-20150129/" rel="previous">http://www.w3.org/TR/2015/WD-css3-break-20150129/</a>
<dt>Feedback:
<dd><span><a href="mailto:www-style@w3.org?subject=%5Bcss-break%5D%20YOUR%20TOPIC%20HERE">www-style@w3.org</a> with subject line “<kbd>[css-break] <var>… message topic …</var></kbd>” (<a href="http://lists.w3.org/Archives/Public/www-style/" rel="discussion">archives</a>)</span>
<dt>Issue Tracking:
<dd><a href="https://github.com/w3c/csswg-drafts/issues/">GitHub</a>
<dd><a href="#issues-index">Inline In Spec</a>
<dt class="editor">Editors:
<dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:ratan@microsoft.com<">Rossen Atanassov</a> (<span class="p-org org">Microsoft</span>)
<dd class="editor p-author h-card vcard"><a class="p-name fn u-url url" href="http://fantasai.inkedblade.net/contact">fantasai</a> (<span class="p-org org">Invited Expert</span>)
</dl>
</div>
<div data-fill-with="warning"></div>
<p class="copyright" data-fill-with="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2015 <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>). 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>
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2>
<div class="p-summary" data-fill-with="abstract">
<p>This module describes the fragmentation model that partitions a flow into pages, columns, or regions.
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.</p>
<a href="http://www.w3.org/TR/CSS/">CSS</a> is a language for describing the rendering of structured documents
(such as HTML and XML)
on screen, on paper, in speech, etc.</div>
<h2 class="no-num no-toc no-ref heading settled" id="status"><span class="content">Status of this document</span></h2>
<div data-fill-with="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>
<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=%5Bcss-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 “css-break” in the subject,
preferably like this:
“[css-break] <em>…summary of comment…</em>”
</p>
<p>
This document was produced by the <a href="http://www.w3.org/Style/CSS/members">CSS Working Group</a>
(part of the <a href="http://www.w3.org/Style/">Style Activity</a>).
</p>
<p>
This document was produced by a group operating under
the <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent Policy</a>.
W3C maintains a <a href="http://www.w3.org/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="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a>
must disclose the information in accordance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the W3C Patent Policy</a>.
</p>
<p>
This document is governed by the <a href="http://www.w3.org/2014/Process-20140801/" id="w3c_process_revision">1 August 2014 W3C Process Document</a>.
</p>
<p>
</p></div>
<div data-fill-with="at-risk"></div>
<h2 class="no-num no-toc no-ref heading settled" id="contents"><span class="content">Table of Contents</span></h2>
<div data-fill-with="table-of-contents" role="navigation">
<ul class="toc" role="directory">
<li><a href="#intro"><span cl FEEA ass="secno">1</span> <span class="content">
Introduction</span></a>
<ul class="toc">
<li><a href="#placement"><span class="secno">1.1</span> <span class="content">
Module Interactions</span></a>
<li><a href="#values"><span class="secno">1.2</span> <span class="content">
Values</span></a>
</ul>
<li><a href="#fragmentation-model"><span class="secno">2</span> <span class="content">
Fragmentation Model and Terminology</span></a>
<ul class="toc">
<li><a href="#parallel-flows"><span class="secno">2.1</span> <span class="content">
Parallel Fragmentation Flows</span></a>
<li><a href="#nested-flows"><span class="secno">2.2</span> <span class="content">
Nested Fragmentation Flows</span></a>
</ul>
<li><a href="#breaking-controls"><span class="secno">3</span> <span class="content">
Controlling Breaks</span></a>
<ul class="toc">
<li><a href="#break-between"><span class="secno">3.1</span> <span class="content">
Breaks Between Boxes: the <span class="property">break-before</span> and <span class="property">break-after</span> properties</span></a>
<ul class="toc">
<li><a href="#generic-break-values"><span class="secno"></span> <span class="content">
Generic Break Values</span></a>
<li><a href="#page-break-values"><span class="secno"></span> <span class="content">
Page Break Values</span></a>
<li><a href="#column-break-values"><span class="secno"></span> <span class="content">
Column Break Values</span></a>
<li><a href="#region-break-values"><span class="secno"></span> <span class="content">
Region Break Values</span></a>
</ul>
<li><a href="#break-within"><span class="secno">3.2</span> <span class="content">
Breaks Within Boxes: the <span class="property">break-inside</span> property</span></a>
<li><a href="#widows-orphans"><span class="secno">3.3</span> <span class="content">
Breaks Between Lines: <span class="property">orphans</span>, <span class="property">widows</span></span></a>
<li><a href="#page-break-properties"><span class="secno">3.4</span> <span class="content">
Page Break Aliases: the <span class="property">page-break-before</span>, <span class="property">page-break-after</span>, and <span class="property">page-break-inside</span> properties</span></a>
</ul>
<li><a href="#breaking-rules"><span class="secno">4</span> <span class="content">
Rules for Breaking</span></a>
<ul class="toc">
<li><a href="#possible-breaks"><span class="secno">4.1</span> <span class="content">
Possible Break Points</span></a>
<li><a href="#break-types"><span class="secno">4.2</span> <span class="content">
Types of Breaks</span></a>
<li><a href="#forced-breaks"><span class="secno">4.3</span> <span class="content">
Forced Breaks</span></a>
<li><a href="#unforced-breaks"><span class="secno">4.4</span> <span class="content">
Unforced Breaks</span></a>
<li><a href="#best-breaks"><span class="secno">4.5</span> <span class="content">
Optimizing Unforced Breaks</span></a>
</ul>
<li><a href="#breaking-boxes"><span class="secno">5</span> <span class="content">
Box Model for Breaking</span></a>
<ul class="toc">
<li><a href="#varying-size-boxes"><span class="secno">5.1</span> <span class="content">
Breaking into Varying-size Fragmentainers</span></a>
<li><a href="#break-margins"><span class="secno">5.2</span> <span class="content">
Adjoining Margins at Breaks</span></a>
<li><a href="#box-splitting"><span class="secno">5.3</span> <span class="content">
Splitting Boxes</span></a>
<li><a href="#break-decoration"><span class="secno">5.4</span> <span class="content">
Fragmented Borders and Backgrounds: the <span class="property">box-decoration-break</span> property</span></a>
<ul class="toc">
<li><a href="#joining-boxes"><span class="secno">5.4.1</span> <span class="content">
Joining Boxes for <span class="css">slice</span></span></a>
</ul>
<li><a href="#transforms"><span class="secno">5.5</span> <span class="content">
Transforms, Positioning, and Pagination</span></a>
</ul>
<li><a href="#changes"><span class="secno"></span> <span class="content">
Changes</span></a>
<li><a href="#acknowledgments"><span class="secno"></span> <span class="content">
Acknowledgments</span></a>
<li><a href="#conformance"><span class="secno"></span> <span class="content">
Conformance</span></a>
<ul class="toc">
<li><a href="#conventions"><span class="secno"></span> <span class="content">
Document conventions</span></a>
<li><a href="#conformance-classes"><span class="secno"></span> <span class="content">
Conformance classes</span></a>
<li><a href="#partial"><span class="secno"></span> <span class="content">
Partial implementations</span></a>
<li><a href="#experimental"><span class="secno"></span> <span class="content">
Experimental implementations</span></a>
<li><a href="#testing"><span class="secno"></span> <span class="content">
Non-experimental implementations</span></a>
</ul>
<li><a href="#index"><span class="secno"></span> <span class="content">Index</span></a>
<ul class="toc">
<li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a>
<li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a>
</ul>
<li><a href="#references"><span class="secno"></span> <span class="content">References</span></a>
<ul class="toc">
<li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a>
<li><a href="#informative"><span class="secno"></span> <span class="content">Informative References</span></a>
</ul>
<li><a href="#property-index"><span class="secno"></span> <span class="content">Property Index</span></a>
<li><a href="#issues-index"><span class="secno"></span> <span class="content">Issues Index</span></a>
</ul></div>
<main>
<h2 class="no-num no-toc heading settled" id="tagline"><span class="content">Breaking the Web, one fragment at a time</span></h2>
<h2 class="heading settled" data-level="1" id="intro"><span class="secno">1. </span><span class="content">
Introduction</span><a class="self-link" href="#intro"></a></h2>
<p><em>This section is not normative.</em></p>
<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 data-dfn-type="dfn" data-noexport="" id="pagination">pagination<a class="self-link" href="#pagination"></a></dfn>.
</p>
<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 data-link-type="biblio" href="#biblio-css3-regions">[CSS3-REGIONS]</a>
and <a href="http://www.w3.org/TR/css3-multicol/">multi-column layout</a>
<a data-link-type="biblio" href="#biblio-css3col">[CSS3COL]</a> create a similarly fragmented environment.
The generic term for breaking content across containers is
<a data-link-type="dfn" href="#fragmentation">fragmentation</a>.
This module explains how content breaks across <a data-link-type="dfn" href="#fragmentation-container">fragmentation containers</a> (<a data-link-type="dfn" href="#fragmentainer">fragmentainers</a>)
such as pages and columns and how such breaks can be
<a href="#breaking-controls">controlled by the author</a>.
</p>
<h3 class="heading settled" data-level="1.1" id="placement"><span class="secno">1.1. </span><span class="content">
Module Interactions</span><a class="self-link" href="#placement"></a></h3>
<p>
This module replaces and extends the pagination controls defined in
<a data-link-type="biblio" href="#biblio-css21">[CSS21]</a> <a href="http://www.w3.org/TR/CSS21/page.html#page-breaks">section 13.3</a>
and in <a data-link-type="biblio" href="#biblio-css3page">[CSS3PAGE]</a>.
</p>
<h3 class="heading settled" data-level="1.2" id="values"><span class="secno">1.2. </span><span class="content">
Values</span><a class="self-link" href="#values"></a></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 data-link-type="biblio" href="#biblio-css21">[CSS21]</a>. Value types not defined
in this specification are defined in CSS Level 2 Revision 1 <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a>. Other CSS
modules may expand the definitions of these value types: for example <a data-link-type="biblio" href="#biblio-css3val">[CSS3VAL]</a>,
when combined with this module, adds the <a class="css" data-link-type="maybe" href="http://dev.w3.org/csswg/css-cascade-4/#valdef-all-initial">initial</a> value
to the properties defined here.</p>
<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.
</p>
<h2 class="heading settled" data-level="2" id="fragmentation-model"><span class="secno">2. </span><span class="content">
Fragmentation Model and Terminology</span><a class="self-link" href="#fragmentation-model"></a></h2>
<dl>
<dt><dfn data-dfn-type="dfn" data-export="" id="fragmentation-container">fragmentation container<a class="self-link" href="#fragmentation-container"></a></dfn> (<dfn data-dfn-type="dfn" data-export="" id="fragmentainer">fragmentainer<a class="self-link" href="#fragmentainer"></a></dfn>)
<dd>
A box—such as a page box, column box, or region—that contains
a portion (or all) of a <a data-link-type="dfn" href="#fragmented-flow">fragmented flow</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 data-link-type="dfn" href="#fragmentation-context">fragmentation context</a>.
<dt><dfn data-dfn-type="dfn" data-export="" id="fragmentation-context">fragmentation context<a class="self-link" href="#fragmentation-context"></a></dfn>
<dd>
An ordered series of <a data-link-type="dfn" href="#fragmentainer">fragmentainers</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 data-link-type="dfn" href="#fragmentainer">fragmentainers</a>.
(Descendants of the <a data-link-type="dfn" href="#fragmentation-root">fragmentation root</a> may have other block flow directions,
but fragmentation proceeds according to the block flow direction applied to the <a data-link-type="dfn" href="#fragmentation-root">fragmentation root</a>.)
<dt><dfn data-dfn-type="dfn" data-export="" id="fragmented-flow">fragmented flow<a class="self-link" href="#fragmented-flow"></a></dfn>
<dd>
A content flow that is being laid out in a <a data-link-type="dfn" href="#fragmentation-context">fragmentation context</a>.
The <a data-link-type="dfn" href="#fragmented-flow">fragmented flow</a> consists of the content of a (possibly anonymous) box
called the <dfn data-dfn-type="dfn" data-export="" id="fragmentation-root">fragmentation root<a class="self-link" href="#fragmentation-root"></a></dfn>.
<dt><dfn data-dfn-type="dfn" data-export="" id="fragmentation-direction">fragmentation direction<a class="self-link" href="#fragmentation-direction"></a></dfn>
<dd>
The block flow direction of the <a data-link-type="dfn" href="#fragmentation-context">fragmentation context</a>,
i.e. the direction in which content is fragmented.
(In this level of CSS, content only fragments in one dimension.)
<dt><dfn data-dfn-type="dfn" data-export="" id="fragmentation">fragmentation<a class="self-link" href="#fragmentation"></a></dfn>
<dd>
The process of splitting a content flow across the <a data-link-type="dfn" href="#fragmentainer">fragmentainers</a>
that form a <a data-link-type="dfn" href="#fragmentation-context">fragmentation context</a>.
<dt><dfn data-dfn-type="dfn" data-export="" id="box-fragment">box fragment<a class="self-link" href="#box-fragment"></a></dfn> or <dfn data-dfn-type="dfn" data-export="" id="fragment">fragment<a class="self-link" href="#fragment"></a></dfn>
<dd>
The portion of a box that belongs to exactly one <a data-link-type="dfn" href="#fragmentainer">fragmentainer</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 data-dfn-type="dfn" data-export="" id="remaining-fragmentainer-extent">remaining fragmentainer extent<a class="self-link" href="#remaining-fragmentainer-extent"></a></dfn>
<dd>
The remaining <a data-link-type="dfn" href="http://dev.w3.org/csswg/css-writing-modes-3/#block-axis">block-axis</a> space in the <a data-link-type="dfn" href="#fragmentainer">fragmentainer</a> available to a given element,
i.e. between the end of preceding content in <a data-link-type="dfn" href="#fragmentainer">fragmentainer</a>
and the edge of the <a data-link-type="dfn" href="#fragmentainer">fragmentainer</a>.
</dl>
<p>
Each <dfn data-dfn-type="dfn" data-noexport="" id="fragmentation-break">fragmentation break<a class="self-link" href="#fragmentation-break"></a></dfn> (hereafter, <dfn data-dfn-type="dfn" data-noexport="" id="break">break<a class="self-link" href="#break"></a></dfn>)
ends layout of the fragmented box in the current <a data-link-type="dfn" href="#fragmentainer">fragmentainer</a>
and causes the remaining content to be laid out in the next <a data-link-type="dfn" href="#fragmentainer">fragmentainer</a>,
in some cases causing a new <a data-link-type="dfn" href="#fragmentainer">fragmentainer</a> to be generated
to hold the deferred content.
</p>
<p class="note" role="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 data-link-type="biblio" href="#biblio-css21">[CSS21]</a>/<a data-link-type="biblio" href="#biblio-css3text">[CSS3TEXT]</a>.
</p>
<h3 class="heading settled" data-level="2.1" id="parallel-flows"><span class="secno">2.1. </span><span class="content">
Parallel Fragmentation Flows</span><a class="self-link" href="#parallel-flows"></a></h3>
<p>
When multiple flows are laid out parallel to each other,
fragmentation is performed independently in each flow.
For example, if an element is floated,
then a forced break inside the float
will not affect the content wrapping outside the float
(except insofar as it may increase the height of the float).
</p>
<p>
The following are examples of parallel flows
whose contents will fragment independently:
</p>
<ul>
<li>The contents of a float vs. the content wrapping outside the float.
<li>The contents of a float vs. the contents of an adjacent float.
<li>The contents of each table cell in a single table row.
<li>The contents of each grid item in a single grid row.
<li>The contents of each flex item in a flex layout row.
<li>The contents of absolutely-positioned elements
that cover the same range of their containing block’s fragmentation context.
</ul>
<p>
Content overflowing the content edge of a fixed-size box
is considered parallel to the content after the fixed-size box
and follows the normal fragmentation rules.
Although overflowing content doesn’t affect the size of the <a data-link-type="dfn" href="#fragmentation-root">fragmentation root</a> box,
it does increase the length of the <a data-link-type="dfn" href="#fragmented-flow">fragmented flow</a>,
spilling into or generating additional <a data-link-type="dfn" href="#fragmentainer">fragmentainers</a> as necessary.
</p>
<h3 class="heading settled" data-level="2.2" id="nested-flows"><span class="secno">2.2. </span><span class="content">
Nested Fragmentation Flows</span><a class="self-link" href="#nested-flows"></a></h3>
<p>
Breaking a <a data-link-type="dfn" href="#fragmentainer">fragmentainer</a> <var>F</var> effectively splits the <a data-link-type="dfn" href="#fragmentainer">fragmentainer</a>
into two <a data-link-type="dfn" href="#fragmentainer">fragmentainers</a> (<var>F<sub>1</sub></var> and <var>F<sub>2</sub></var>).
The only difference is that,
with regards to the content of <a data-link-type="dfn" href="#fragmentainer">fragmentainer</a> <var>F</var>,
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 data-link-type="dfn" href="#fragmentation-context">fragmentation context</a> that split <var>F</var>,
not the type of break normally created by <var>F</var>’s own <a data-link-type="dfn" href="#fragmentation-context">fragmentation context</a>.
</p>
<div class="example" id="example-336a11b1"><a class="self-link" href="#example-336a11b1"></a>
For example, if a region box is broken at a page boundary,
then the content of the region will be affected by a page break at that point
(but not by a region break).
</div>
<div class="note" role="note">
Note that when a multi-column element breaks across pages,
it generates a new row of columns on the next page for the rest of its content,
so that a page break within a multi-column element
is always both a page break and a column break.
</div>
<h2 class="heading settled" data-level="3" id="breaking-controls"><span class="secno">3. </span><span class="content">
Controlling Breaks</span><a class="self-link" href="#breaking-controls"></a></h2>
<p>
The following sections explain how breaks are controlled in a <a data-link-type="dfn" href="#fragmented-flow">fragmented flow</a>.
A page/column/region break opportunity between two boxes
is under the influence of
the containing block’s <a class="property" data-link-type="propdesc" href="#propdef-break-inside">break-inside</a> property,
the <a class="property" data-link-type="propdesc" href="#propdef-break-after">break-after</a> property of the preceding element,
and the <a class="property" data-link-type="propdesc" href="#propdef-break-before">break-before</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 class="property" data-link-type="propdesc" href="#propdef-break-inside">break-inside</a>, <a class="property" data-link-type="propdesc" href="#propdef-widows">widows</a>, and <a class="property" data-link-type="propdesc" href="#propdef-orphans">orphans</a> properties.
A fragmentation break can be
allowed, forced, or discouraged depending on the values of these properties.
A forced break overrides any break restrictions acting at that break point.
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>
<p>
See the section on <a href="#breaking-rules">rules for breaking</a>
for the exact rules on how these properties affect fragmentation.
</p>
<h3 class="heading settled" data-level="3.1" id="break-between"><span class="secno">3.1. </span><span class="content">
Breaks Between Boxes: the <a class="property" data-link-type="propdesc" href="#propdef-break-before">break-before</a> and <a class="property" data-link-type="propdesc" href="#propdef-break-after">break-after</a> properties</span><a class="self-link" href="#break-between"></a></h3>
<table class="propdef">
<tbody>
<tr>
<th>Name:
<td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-break-before">break-before<a class="self-link" href="#propdef-break-before"></a></dfn>, <dfn class="css" data-dfn-type="property" data-export="" id="propdef-break-after">break-after<a class="self-link" href="#propdef-break-after"></a></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 data-dfn-type="dfn" data-noexport="" id="forced-break-values">forced break values<a class="self-link" href="#forced-break-values"></a></dfn>
<a class="css" data-link-type="maybe" href="#valdef-break-before-always">always</a>, <a class="css" data-link-type="maybe" href="#valdef-break-before-any">any</a>, <a class="css" data-link-type="maybe" href="#valdef-break-before-left">left</a>, <a class="css" data-link-type="maybe" href="#valdef-break-before-right">right</a>, <a class="css" data-link-type="maybe" href="#valdef-break-before-recto">recto</a>, <a class="css" data-link-type="maybe" href="#valdef-break-before-verso">verso</a>, <a class="css" data-link-type="maybe" href="#valdef-break-before-page">page</a>, <a class="css" data-link-type="maybe" href="#valdef-break-before-column">column</a> and <a class="css" data-link-type="maybe" href="#valdef-break-before-region">region</a>
create a <a href="#forced-breaks">forced break</a> in the flow
while the <dfn data-dfn-type="dfn" data-noexport="" id="avoid-break-values">avoid break values<a class="self-link" href="#avoid-break-values"></a></dfn>
<a class="css" data-link-type="maybe" href="#valdef-break-before-avoid">avoid</a>, <a class="css" data-link-type="maybe" href="#valdef-break-before-avoid-page">avoid-page</a>, <a class="css" data-link-type="maybe" href="#valdef-break-before-avoid-column">avoid-column</a> and <a class="css" data-link-type="maybe" href="#valdef-break-before-avoid-region">avoid-region</a>
indicate that content should be kept together.
</p>
<p>
Since breaks are only allowed between siblings,
not between a box and its container (see <a href="#possible-breaks">Possible Break Points</a>),
a <a class="property" data-link-type="propdesc" href="#propdef-break-before">break-before</a> value on a first-child box is propagated to its container.
Likewise a <a class="property" data-link-type="propdesc" href="#propdef-break-after">break-after</a> value on a last-child box is propagated to its container.
(Conflicting values <a href="#forced-breaks">combine</a> as defined below.)
This propagation stops before it breaks through the nearest matching fragmentation context.
</p>
<p>
Values for <a class="property" data-link-type="propdesc" href="#propdef-break-before">break-before</a> and <a class="property" data-link-type="propdesc" href="#propdef-break-after">break-after</a> are defined in the sub-sections below.
User Agents must apply these properties to boxes in the normal flow of the <a data-link-type="dfn" href="#fragmentation-root">fragmentation root</a>.
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>
<h4 class="no-num heading settled" id="generic-break-values"><span class="content">
Generic Break Values</span><a class="self-link" href="#generic-break-values"></a></h4>
<p>
These values have an effect regardless of
the type of fragmented context containing the flow.
</p>
<dl>
<dt><dfn class="css" data-dfn-for="break-before,break-after" data-dfn-type="value" data-export="" id="valdef-break-before-auto">auto<a class="self-link" href="#valdef-break-before-auto"></a></dfn>
<dd>
Neither force nor forbid a break before/after the <a href="http://www.w3.org/TR/CSS21/visuren.html#block-boxes">principal box</a>.
<dt><dfn class="css" data-dfn-for="break-before,break-after" data-dfn-type="value" data-export="" id="valdef-break-before-avoid">avoid<a class="self-link" href="#valdef-break-before-avoid"></a></dfn>
<dd>
Avoid a break before/after the <a href="http://www.w3.org/TR/CSS21/visuren.html#block-boxes">principal box</a>.
<dt><dfn class="css" data-dfn-for="break-before,break-after" data-dfn-type="value" data-export="" id="valdef-break-before-always">always<a class="self-link" href="#valdef-break-before-always"></a></dfn>
<dd>
Always force a break
(of all possible types, through all fragmentation contexts)
before/after the <a href="http://www.w3.org/TR/CSS21/visuren.html#block-boxes">principal box</a>.
<dt><dfn class="css" data-dfn-for="break-before,break-after" data-dfn-type="value" data-export="" id="valdef-break-before-any">any<a class="self-link" href="#valdef-break-before-any"></a></dfn>
<dd>
Force a break of any type, whichever is the type of the deepest fragmentation context,
before/after the <a href="http://www.w3.org/TR/CSS21/visuren.html#block-boxes">principal box</a>.
</dl>
<h4 class="no-num heading settled" id="page-break-values"><span class="content">
Page Break Values</span><a class="self-link" href="#page-break-values"></a></h4>
<p>
These values only have an effect in paginated contexts;
if the flow is not paginated, they have no effect.
</p>
<dl>
<dt><dfn class="css" data-dfn-for="break-before,break-after" data-dfn-type="value" data-export="" id="valdef-break-before-avoid-page">avoid-page<a class="self-link" href="#valdef-break-before-avoid-page"></a></dfn>
<dd>
Avoid a page break before/after the <a href="http://www.w3.org/TR/CSS21/visuren.html#block-boxes">principal box</a>.
<dt><dfn class="css" data-dfn-for="break-before,break-after" data-dfn-type="value" data-export="" id="valdef-break-before-page">page<a class="self-link" href="#valdef-break-before-page"></a></dfn>
<dd>
Always force a page break before/after the <a href="http://www.w3.org/TR/CSS21/visuren.html#block-boxes">principal box</a>.
<dt><dfn class="css" data-dfn-for="break-before,break-after" data-dfn-type="value" data-export="" id="valdef-break-before-left">left<a class="self-link" href="#valdef-break-before-left"></a></dfn>
<dd>
Force one or two page breaks before/after the <a href="http://www.w3.org/TR/CSS21/visuren.html#block-boxes">principal box</a> so that the next page is formatted as a left page.
<dt><dfn class="css" data-dfn-for="break-before,break-after" data-dfn-type="value" data-export="" id="valdef-break-before-right">right<a class="self-link" href="#valdef-break-before-right"></a></dfn>
<dd>
Force one or two page breaks before/after the <a href="http://www.w3.org/TR/CSS21/visuren.html#block-boxes">principal box</a> so that the next page is formatted as a right page.
<dt><dfn class="css" data-dfn-for="break-before,break-after" data-dfn-type="value" data-export="" id="valdef-break-before-recto">recto<a class="self-link" href="#valdef-break-before-recto"></a></dfn>
<dd>
Force one or two page breaks before/after the <a href="http://www.w3.org/TR/CSS21/visuren.html#block-boxes">principal box</a> so that
the next page is formatted as either a left page or a right page,
whichever is second (according to the <a data-link-type="dfn" href="http://dev.w3.org/csswg/css-page-3/#page-progression">page progression</a>) in a page spread.
<dt><dfn class="css" data-dfn-for="break-before,break-after" data-dfn-type="value" data-export="" id="valdef-break-before-verso">verso<a class="self-link" href="#valdef-break-before-verso"></a></dfn>
<dd>
Force one or two page breaks before/after the <a href="http://www.w3.org/TR/CSS21/visuren.html#block-boxes">principal box</a> so that
the next page is formatted as either a left page or a right page,
whichever is first (according to the <a data-link-type="dfn" href="http://dev.w3.org/csswg/css-page-3/#page-progression">page progression</a>) in a page spread.
</dl>
<h4 class="no-num heading settled" id="column-break-values"><span class="content">
Column Break Values</span><a class="self-link" href="#column-break-values"></a></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.
</p>
<dl>
<dt><dfn class="css" data-dfn-for="break-before,break-after" data-dfn-type="value" data-export="" id="valdef-break-before-avoid-column">avoid-column<a class="self-link" href="#valdef-break-before-avoid-column"></a></dfn>
<dd>
Avoid a column break before/after the <a href="http://www.w3.org/TR/CSS21/visuren.html#block-boxes">principal box</a>.
<dt><dfn class="css" data-dfn-for="break-before,break-after" data-dfn-type="value" data-export="" id="valdef-break-before-column">column<a class="self-link" href="#valdef-break-before-column"></a></dfn>
<dd>
Always force a column break before/after the <a href="http://www.w3.org/TR/CSS21/visuren.html#block-boxes">principal box</a>.
</dl>
<h4 class="no-num heading settled" id="region-break-values"><span class="content">
Region Break Values</span><a class="self-link" href="#region-break-values"></a></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.
</p>
<dl>
<dt><dfn class="css" data-dfn-for="break-before,break-after" data-dfn-type="value" data-export="" id="valdef-break-before-avoid-region">avoid-region<a class="self-link" href="#valdef-break-before-avoid-region"></a></dfn>
<dd>
Avoid a region break before/after the <a href="http://www.w3.org/TR/CSS21/visuren.html#block-boxes">principal box</a>.
<dt><dfn class="css" data-dfn-for="break-before,break-after" data-dfn-type="value" data-export="" id="valdef-break-before-region">region<a class="self-link" href="#valdef-break-before-region"></a></dfn>
<dd>
Always force a region break before/after the <a href="http://www.w3.org/TR/CSS21/visuren.html#block-boxes">principal box</a>.
</dl>
<h3 class="heading settled" data-level="3.2" id="break-within"><span class="secno">3.2. </span><span class="content">
Breaks Within Boxes: the <a class="property" data-link-type="propdesc" href="#propdef-break-inside">break-inside</a> property</span><a class="self-link" href="#break-within"></a></h3>
<table class="propdef">
<tbody>
<tr>
<th>Name:
<td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-break-inside">break-inside<a class="self-link" href="#propdef-break-inside"></a></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 establish formatting contexts,
or that 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 element’s principal box.
Values have the following meanings:
</p>
<dl>
<dt><dfn class="css" data-dfn-for="break-inside,page-break-inside" data-dfn-type="value" data-export="" id="valdef-break-inside-auto">auto<a class="self-link" href="#valdef-break-inside-auto"></a></dfn>
<dd>
Impose no additional breaking constraints within the box.
<dt><dfn class="css" data-dfn-for="break-inside,page-break-inside" data-dfn-type="value" data-export="" id="valdef-break-inside-avoid">avoid<a class="self-link" href="#valdef-break-inside-avoid"></a></dfn>
<dd>
Avoid breaks within the box.
<dt><dfn class="css" data-dfn-for="break-inside,page-break-inside" data-dfn-type="value" data-export="" id="valdef-break-inside-avoid-page">avoid-page<a class="self-link" href="#valdef-break-inside-avoid-page"></a></dfn>
<dd>
Avoid a page break within the box.
<dt><dfn class="css" data-dfn-for="break-inside,page-break-inside" data-dfn-type="value" data-export="" id="valdef-break-inside-avoid-column">avoid-column<a class="self-link" href="#valdef-break-inside-avoid-column"></a></dfn>
<dd>
Avoid a column break within the box.
<dt><dfn class="css" data-dfn-for="break-inside,page-break-inside" data-dfn-type="value" data-export="" id="valdef-break-inside-avoid-region">avoid-region<a class="self-link" href="#valdef-break-inside-avoid-region"></a></dfn>
<dd>
Avoid a region break within the box.
</dl>
<h3 class="heading settled" data-level="3.3" id="widows-orphans"><span class="secno">3.3. </span><span class="content">
Breaks Between Lines: <a class="property" data-link-type="propdesc" href="#propdef-orphans">orphans</a>, <a class="property" data-link-type="propdesc" href="#propdef-widows">widows</a></span><a class="self-link" href="#widows-orphans"></a></h3>
<table class="propdef">
<tbody>
<tr>
<th>Name:
<td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-orphans">orphans<a class="self-link" href="#propdef-orphans"></a></dfn>, <dfn class="css" data-dfn-type="property" data-export="" id="propdef-widows">widows<a class="self-link" href="#propdef-widows"></a></dfn>
<tr>
<th>Value:
<td>&lt;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 class="property" data-link-type="propdesc" href="#propdef-orphans">orphans</a> property specifies the minimum number
of line boxes in a block container
that must be left in a <a data-link-type="dfn" href="#fragment">fragment</a> <em>before</em> a fragmentation break.
The <a class="property" data-link-type="propdesc" href="#propdef-widows">widows</a> property specifies the minimum number
of line boxes of a block container
that must be left in a <a data-link-type="dfn" href="#fragment">fragment</a> <em>after</em> a break.
Examples of how they are used to control fragmentation breaks are given
<a href="#widows-orphans-example">below</a>.
</p>
<p>
Only positive integers are allowed as values of <a class="property" data-link-type="propdesc" href="#propdef-orphans">orphans</a> and <a class="property" data-link-type="propdesc" href="#propdef-widows">widows</a>.
Negative values and zero are invalid and must cause the declaration to be
<a href="http://www.w3.org/TR/CSS21/conform.html#ignore">ignored</a>.
</p>
<p>
If a block contains fewer lines than the value of <a class="property" data-link-type="propdesc" href="#propdef-widows">widows</a> or <a class="property" data-link-type="propdesc" href="#propdef-orphans">orphans</a>,
the rule simply becomes that all lines in the block must be kept together.
</p>
<h3 class="heading settled" data-level="3.4" id="page-break-properties"><span class="secno">3.4. </span><span class="content">
Page Break Aliases: the <a class="property" data-link-type="propdesc" href="http://dev.w3.org/csswg/css2/page.html#propdef-page-break-before">page-break-before</a>, <a class="property" data-link-type="propdesc" href="http://dev.w3.org/csswg/css2/page.html#propdef-page-break-after">page-break-after</a>, and <a class="property" data-link-type="propdesc" href="http://dev.w3.org/csswg/css2/page.html#propdef-page-break-inside">page-break-inside</a> properties</span><a class="self-link" href="#page-break-properties"></a></h3>