First Public Working Draft · css-break

CSS Fragmentation

7 properties defined by this specification, 6 of them known to at least one browser (the others are badged Not in any browser yet).

Each feature in detail

box-decoration-break

Property Limited availability Modern CSS: box-decoration-break

MDN The box-decoration-break CSS property specifies how an element's fragments should be rendered when broken across multiple lines, columns, or pages.

Live preview Example from MDN
#example-container {
  width: 14rem;
}

#example-element {
  background: linear-gradient(to bottom right, #6f6f6f, black);
  color: white;
  box-shadow:
    8px 8px 10px 0 #ff1492,
    -5px -5px 5px 0 blue,
    5px 5px 15px 0 yellow;
  padding: 0 1em;
  border-radius: 16px;
  border-style: solid;
  margin-left: 10px;
  font: 24px sans-serif;
  line-height: 2;
}

Syntax

slice | clone

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
slice
Applies to
all elements
Inherited
no
Percentages
n/a
Computed value
specified keyword
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting box-decoration-break
Chrome 130
Edge 130
Firefox 32
Safari 7 (-webkit- prefix)
Chrome Android 130
Safari iOS 7 (-webkit- prefix)

First version with support, from MDN browser-compat-data.

break-after

Property Baseline: widely availablesince July 2021

MDN The break-after CSS property sets how page, column, or region breaks should behave after a generated box. If there is no generated box, the property is ignored.

Live preview Example from MDN
.box {
  border: solid #5b6dcd 5px;
  background-color: #5b6dcd;
  margin: 10px 0;
  padding: 5px;
}

#example-element {
  border: solid 5px #ffc129;
  background-color: #ffc129;
  color: black;
}

Syntax

auto | avoid | always | all | avoid-page | page | left | right | recto | verso | avoid-column | column | avoid-region | region

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
auto
Applies to
block-level boxes, grid items, flex items, table row groups, table rows (but see prose)
Inherited
no
Percentages
n/a
Computed value
specified keyword
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting break-after
Chrome 50
Edge 12
Firefox 65
Safari 10
Chrome Android 50
Safari iOS 10

First version with support, from MDN browser-compat-data.

break-before

Property Baseline: widely availablesince July 2021

MDN The break-before CSS property sets how page, column, or region breaks should behave before a generated box. If there is no generated box, the property is ignored.

Live preview Example from MDN
.box {
  border: solid #5b6dcd 5px;
  background-color: #5b6dcd;
  margin: 10px 0;
  padding: 5px;
}

#example-element {
  border: solid 5px #ffc129;
  background-color: #ffc129;
  color: black;
}

Syntax

auto | avoid | always | all | avoid-page | page | left | right | recto | verso | avoid-column | column | avoid-region | region

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
auto
Applies to
block-level boxes, grid items, flex items, table row groups, table rows (but see prose)
Inherited
no
Percentages
n/a
Computed value
specified keyword
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting break-before
Chrome 50
Edge 12
Firefox 65
Safari 10
Chrome Android 50
Safari iOS 10

First version with support, from MDN browser-compat-data.

break-inside

Property Baseline: widely availablesince July 2021

MDN The break-inside CSS property sets how page, column, or region breaks should behave inside a generated box. If there is no generated box, the property is ignored.

Live preview Example from MDN
.box {
  border: solid #5b6dcd 5px;
  background-color: #5b6dcd;
  margin: 10px 0;
  padding: 5px;
}

#example-element {
  border: solid 5px #ffc129;
  background-color: #ffc129;
  color: black;
}

@media print {
  #example-element {
    height: 25cm;
  }
}

Syntax

auto | avoid | avoid-page | avoid-column | avoid-region

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
auto
Applies to
all elements except inline-level boxes, internal ruby boxes, table column boxes, table column group boxes, absolutely-positioned boxes
Inherited
no
Percentages
n/a
Computed value
specified keyword
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting break-inside
Chrome 50
Edge 12
Firefox 65
Safari 10
Chrome Android 50
Safari iOS 10

First version with support, from MDN browser-compat-data.

margin-break

Property Not in any browser yet

No prose in the spec's definition and no MDN page yet: the spec link below is the only description.

Syntax

auto | keep | discard

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
auto
Applies to
all elements
Inherited
no
Percentages
n/a
Computed value
specified keyword
Canonical order
per grammar
Animation type
discrete

orphans

Property Limited availability

MDN The orphans CSS property sets the minimum number of lines in a block container that must be shown at the bottom of a page, region, or column.

Live preview Example from MDN
div {
  background-color: #8cffa0;
  width: 420px;
  height: 120px;
  columns: 3;
  column-fill: auto;
  orphans: 1;
  widows: 1;
}

div:has(~ form input:checked) {
  orphans: 2;
}

p {
  background-color: #8ca0ff;
}

p:first-child {
  margin-top: 0;
}

Syntax

<integer [1,∞]>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
2
Applies to
block containers that establish an inline formatting context
Inherited
yes
Percentages
n/a
Computed value
specified integer
Canonical order
per grammar
Animation type
by computed value type

Browser support

First browser version supporting orphans
Chrome 25
Edge 12
Firefox No
Safari 1.3
Chrome Android 25
Safari iOS 1

First version with support, from MDN browser-compat-data.

widows

Property Limited availability

MDN The widows CSS property sets the minimum number of lines in a block container that must be shown at the top of a page, region, or column.

Live preview Example from MDN
div {
  background-color: #8cffa0;
  width: 400px;
  height: 160px;
  columns: 3;
  column-fill: auto;
  orphans: 1;
  widows: 1;
}

div:has(~ form input:checked) {
  widows: 2;
}

p {
  background-color: #8ca0ff;
}

p:first-child {
  margin-top: 0;
}

Syntax

<integer [1,∞]>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
2
Applies to
block containers that establish an inline formatting context
Inherited
yes
Percentages
n/a
Computed value
specified integer
Canonical order
per grammar
Animation type
by computed value type

Browser support

First browser version supporting widows
Chrome 25
Edge 12
Firefox No
Safari 1.3
Chrome Android 25
Safari iOS 1

First version with support, from MDN browser-compat-data.