box-decoration-break CSS property

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

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

Try it

-webkit-box-decoration-break: slice;
box-decoration-break: slice;
-webkit-box-decoration-break: clone;
box-decoration-break: clone;
<section id="default-example">
  <div id="example-container">
    <span id="example-element">This text breaks across multiple lines.</span>
  </div>
</section>
#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

css
/* Keyword values */
box-decoration-break: slice;
box-decoration-break: clone;

/* Global values */
box-decoration-break: inherit;
box-decoration-break: initial;
box-decoration-break: revert;
box-decoration-break: revert-layer;
box-decoration-break: unset;

The box-decoration-break property is specified as one of the keyword values listed below.

Values

slice

The element is initially rendered as if its box were not fragmented, after which the rendering for this hypothetical box is sliced into pieces for each line/column/page. Note that the hypothetical box can be different for each fragment since it uses its own height if the break occurs in the inline direction, and its own width if the break occurs in the block direction. See the CSS specification for details.

clone

Each box fragment is rendered independently with the specified border, padding, and margin wrapping each fragment. The border-radius, border-image, and box-shadow are applied to each fragment independently. The background is also drawn independently for each fragment, which means that a background image with background-repeat: no-repeat may nevertheless repeat multiple times.

Description

The specified value will impact the appearance of the following properties:

Formal definition

Initial valueslice
Applies toall elements
Inheritedno
Computed valueas specified
Animation typediscrete

Formal syntax

box-decoration-break = 
slice |
clone

Examples

Inline box fragments

An inline element with a box decoration may have unexpected appearance when it contains line breaks due to the initial slice value. The following example shows the effect of adding box-decoration-break: clone to a <span> that contains <br> tags:

css
span {
  background: linear-gradient(to bottom right, yellow, green);
  box-shadow:
    8px 8px 10px 0px deeppink,
    -5px -5px 5px 0px blue,
    5px 5px 15px 0px yellow;
}

#clone {
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
html
<p>
  <span>The<br />quick<br />orange fox</span>
</p>
<p>
  <span id="clone">The<br />quick<br />orange fox</span>
</p>

Block box fragments

The following example shows how block elements with box decoration look when they contain line breaks in a multi-column layout. Notice how the result of box-decoration-break: slice would be the equivalent of the first <div> if stacked vertically.

css
span {
  display: block;
  background: linear-gradient(to bottom right, yellow, green);
  box-shadow:
    inset 8px 8px 10px 0px deeppink,
    inset -5px -5px 5px 0px blue,
    inset 5px 5px 15px 0px yellow;
}
#base {
  width: 33%;
}
.columns {
  columns: 3;
}

.clone {
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
html
<div id="base">
  <span>The<br />quick<br />orange fox</span>
</div>
<br />

<h2>'box-decoration-break: slice'</h2>
<div class="columns">
  <span>The<br />quick<br />orange fox</span>
</div>

<h2>'box-decoration-break: clone'</h2>
<div class="columns">
  <span class="clone">The<br />quick<br />orange fox</span>
</div>

Specifications

Specification
CSS Fragmentation Module Level 3
# break-decoration

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
box-decoration-break
Chrome – Partial support
Chrome 22 (Release date: 2012-09-25)
prefix
footnote Partial support
prefix Implemented with the vendor prefix: -webkit-
footnote This property is only supported for inline elements.
Chrome – Full support
Chrome 130 (Release date: 2024-10-15)
footnote Full support
Edge – Partial support
Edge 79 (Release date: 2020-01-15)
prefix
footnote Partial support
prefix Implemented with the vendor prefix: -webkit-
footnote This property is only supported for inline elements.
Edge – Full support
Edge 130 (Release date: 2024-10-17)
footnote Full support
Firefox – Full support
Firefox 32 (Release date: 2014-09-02)
footnote Full support
Opera – No support
Opera 11.5 – 12.1 (Release date: 2011-06-28)
unknown Support unknown
Opera – Full support
Opera 15 (Release date: 2013-07-02)
prefix
prefix Implemented with the vendor prefix: -webkit-
Opera – Full support
Opera 115 (Release date: 2024-11-27)
footnote Full support
Safari – Partial support
Safari 7 (Release date: 2013-10-22)
prefix
footnote Partial support
prefix Implemented with the vendor prefix: -webkit-
footnote This property is only supported for inline elements.
Chrome Android – Partial support
Chrome Android 25 (Release date: 2013-02-27)
prefix
footnote Partial support
prefix Implemented with the vendor prefix: -webkit-
footnote This property is only supported for inline elements.
Chrome Android – Full support
Chrome Android 130 (Release date: 2024-10-15)
footnote Full support
Firefox for Android – Full support
Firefox for Android 32 (Release date: 2014-09-02)
footnote Full support
Opera Android – No support
Opera Android 11.5 – 12.1 (Release date: 2011-10-12)
unknown Support unknown
Opera Android – Full support
Opera Android 14 (Release date: 2013-05-21)
prefix
prefix Implemented with the vendor prefix: -webkit-
Opera Android – Full support
Opera Android 86 (Release date: 2024-12-02)
footnote Full support
Safari on iOS – Partial support
Safari on iOS 7 (Release date: 2013-09-18)
prefix
footnote Partial support
prefix Implemented with the vendor prefix: -webkit-
footnote This property is only supported for inline elements.
Samsung Internet – Partial support
Samsung Internet 1.5 (Release date: 2013-09-25)
prefix
footnote Partial support
prefix Implemented with the vendor prefix: -webkit-
footnote This property is only supported for inline elements.
Samsung Internet – Full support
Samsung Internet 28 (Release date: 2025-04-02)
footnote Full support
WebView Android – Partial support
WebView Android 4.4 (Release date: 2013-12-09)
prefix
footnote Partial support
prefix Implemented with the vendor prefix: -webkit-
footnote This property is only supported for inline elements.
WebView Android – Full support
WebView Android 130 (Release date: 2024-10-15)
footnote Full support
WebView on iOS – Partial support
WebView on iOS 7 (Release date: 2013-09-18)
prefix
footnote Partial support
prefix Implemented with the vendor prefix: -webkit-
footnote This property is only supported for inline elements.
clone
Chrome – Partial support
Chrome 22 – 129 (Release date: 2012-09-25)
footnote Partial support
footnote This value was only supported with the -webkit- prefix.
Chrome – Full support
Chrome 130 (Release date: 2024-10-15)
footnote Full support
Edge – Partial support
Edge 79 – 129 (Release date: 2020-01-15)
footnote Partial support
footnote This value was only supported with the -webkit- prefix.
Edge – Full support
Edge 130 (Release date: 2024-10-17)
footnote Full support
Firefox – Full support
Firefox 32 (Release date: 2014-09-02)
footnote Full support
Opera – Partial support
Opera 15 – 114 (Release date: 2013-07-02)
footnote Partial support
footnote This value was only supported with the -webkit- prefix.
Opera – Full support
Opera 115 (Release date: 2024-11-27)
footnote Full support
Safari – Full support
Safari 7 (Release date: 2013-10-22)
footnote Full support
Chrome Android – Partial support
Chrome Android 25 – 129 (Release date: 2013-02-27)
footnote Partial support
footnote This value was only supported with the -webkit- prefix.
Chrome Android – Full support
Chrome Android 130 (Release date: 2024-10-15)
footnote Full support
Firefox for Android – Full support
Firefox for Android 32 (Release date: 2014-09-02)
footnote Full support
Opera Android – Partial support
Opera Android 14 – 85 (Release date: 2013-05-21)
footnote Partial support
footnote This value was only supported with the -webkit- prefix.
Opera Android – Full support
Opera Android 86 (Release date: 2024-12-02)
footnote Full support
Safari on iOS – Full support
Safari on iOS 7 (Release date: 2013-09-18)
footnote Full support
Samsung Internet – Partial support
Samsung Internet 1.5 – 27 (Release date: 2013-09-25)
footnote Partial support
footnote This value was only supported with the -webkit- prefix.
Samsung Internet – Full support
Samsung Internet 28 (Release date: 2025-04-02)
footnote Full support
WebView Android – Partial support
WebView Android 4.4 – 129 (Release date: 2013-12-09)
footnote Partial support
footnote This value was only supported with the -webkit- prefix.
WebView Android – Full support
WebView Android 130 (Release date: 2024-10-15)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support
slice
Chrome – Partial support
Chrome 22 – 129 (Release date: 2012-09-25)
footnote Partial support
footnote This value was only supported with the -webkit- prefix.
Chrome – Full support
Chrome 130 (Release date: 2024-10-15)
footnote Full support
Edge – Partial support
Edge 79 – 129 (Release date: 2020-01-15)
footnote Partial support
footnote This value was only supported with the -webkit- prefix.
Edge – Full support
Edge 130 (Release date: 2024-10-17)
footnote Full support
Firefox – Full support
Firefox 32 (Release date: 2014-09-02)
footnote Full support
Opera – Partial support
Opera 15 – 114 (Release date: 2013-07-02)
footnote Partial support
footnote This value was only supported with the -webkit- prefix.
Opera – Full support
Opera 115 (Release date: 2024-11-27)
footnote Full support
Safari – Full support
Safari 7 (Release date: 2013-10-22)
footnote Full support
Chrome Android – Partial support
Chrome Android 25 – 129 (Release date: 2013-02-27)
footnote Partial support
footnote This value was only supported with the -webkit- prefix.
Chrome Android – Full support
Chrome Android 130 (Release date: 2024-10-15)
footnote Full support
Firefox for Android – Full support
Firefox for Android 32 (Release date: 2014-09-02)
footnote Full support
Opera Android – Partial support
Opera Android 14 – 85 (Release date: 2013-05-21)
footnote Partial support
footnote This value was only supported with the -webkit- prefix.
Opera Android – Full support
Opera Android 86 (Release date: 2024-12-02)
footnote Full support
Safari on iOS – Full support
Safari on iOS 7 (Release date: 2013-09-18)
footnote Full support
Samsung Internet – Partial support
Samsung Internet 1.5 – 27 (Release date: 2013-09-25)
footnote Partial support
footnote This value was only supported with the -webkit- prefix.
Samsung Internet – Full support
Samsung Internet 28 (Release date: 2025-04-02)
footnote Full support
WebView Android – Partial support
WebView Android 4.4 – 129 (Release date: 2013-12-09)
footnote Partial support
footnote This value was only supported with the -webkit- prefix.
WebView Android – Full support
WebView Android 130 (Release date: 2024-10-15)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
No support
No support
Requires a vendor prefix or different name for use.
Has more compatibility info.

See also