![Rachel Andrew](https://web.dev/images/authors/rachelandrew.jpg) Rachel Andrew Technical Writer [GitHub](https://github.com/rachelandrew) [LinkedIn](https://www.linkedin.com/in/rachelandrew) [Mastodon](https://front-end.social/@rachelandrew) [Bluesky](https://bsky.app/profile/rachelandrew.bsky.social) [Homepage](https://rachelandrew.co.uk)

<br />


Published: October 11, 2024

<br />

In Chrome 130 the
[`box-decoration-break`](https://developer.mozilla.org/docs/Web/CSS/box-decoration-break)
CSS property with a value of `clone`
is available,
with support for inline and block fragmentation. This post explains why and how
to use it.

> [!NOTE]
> **Note:** Firefox also fully supports this property. In Safari, `box-decoration-break` is supported with the `-webkit-` prefix, and only for inline fragmentation.

## Inline fragmentation

Inline fragmentation is what happens when an inline element, for example a
string of text, breaks over multiple lines. Inline elements have a box,
which you typically don't need to think about, unless you try to add a
background or border to the element. In the following example a background
with a `border-radius` is added to a span. The border only curves at the
beginning and end of the string.

```css
span {
  background-color: #002856;
  color: #fff;
  border-radius: 0.5em;
  border: 2px solid black;
}
```

![A wrapped line of text with a background sliced where it wraps.](https://developer.chrome.com/static/blog/box-decoration-break/image/inline-slice.png)

The initial value of `box-decoration-break` is `slice`, which gives this sliced
effect on the boxes. The newly supported `box-decoration-break: clone`
however, means that each line begins and ends with the rounded border.

```css
span {
  background-color: #002856;
  color: #fff;
  border-radius: 0.5em;
  border: 2px solid black;
  box-decoration-break: clone;
}
```

![A wrapped line of text with a background with rounded corners where it wraps.](https://developer.chrome.com/static/blog/box-decoration-break/image/inline-clone.png)
<iframe height="449.3906555175781" style="width: 100%;" scrolling="no" title="Untitled" src="https://codepen.io/web-dot-dev/embed/JjgEXPX?default-tab=css%2Cresult" frameborder="no" loading="lazy" allowtransparency="true" allowfullscreen="true">
See the Pen <a href="https://codepen.io/web-dot-dev/pen/JjgEXPX">
inline box-decoration-break</a> by web.dev (<a href="https://codepen.io/web-dot-dev">@web-dot-dev</a>)
on <a href="https://codepen.io">CodePen</a>.
</iframe>

## Block fragmentation

Block fragmentation happens if you break content into columns with
multiple-column layout, or when you print and the content breaks into pages.

In the following example, content is broken into columns, and each paragraph
has a border. With the initial value of `slice` the boxes are sliced at the
bottom and top of columns.

```css
.columns {
  column-count: 5;
}

.columns p {
  border: 5px solid #34c9eb;
  padding: 0.5em;
}
```

![Multiple columns with sliced boxes.](https://developer.chrome.com/static/blog/box-decoration-break/image/block-slice.png)

With `box-decoration-break: clone`, when a box is fragmented, each fragment is
wrapped with the border.

```css
.columns {
  column-count: 5;
}

.columns p {
  border: 5px solid #34c9eb;
  padding: 0.5em;
  box-decoration-break: clone;
}
```

![Multiple columns with cloned boxes.](https://developer.chrome.com/static/blog/box-decoration-break/image/block-clone.png)
<iframe height="469.6812438964844" style="width: 100%;" scrolling="no" title="multicol with box-decoration-break: clone" src="https://codepen.io/web-dot-dev/embed/VwoPeNP?default-tab=result" frameborder="no" loading="lazy" allowtransparency="true" allowfullscreen="true">
See the Pen <a href="https://codepen.io/web-dot-dev/pen/VwoPeNP">
multicol with box-decoration-break: clone</a> by web.dev (<a href="https://codepen.io/web-dot-dev">@web-dot-dev</a>)
on <a href="https://codepen.io">CodePen</a>.
</iframe>

The same thing happens if you have borders on boxes that are fragmented when
printing the page. If a box is split over two pages, the border on the box
will complete on the first page then open a new box on the second page.