The box-decoration-break property controls how backgrounds, padding, borders, and rounded corners look when an element is split into pieces. Use it when styled text or boxes break across lines, columns, or pages.
01
Fragmentation
When one box becomes many.
02
slice
One continuous decoration.
03
clone
Decorate each fragment.
04
Columns
Multi-column layouts.
05
Line Wraps
Inline text that wraps.
06
Prefixes
WebKit fallback support.
Fundamentals
Definition and Usage
The box-decoration-break CSS property specifies how the background, padding, border, border-radius, box-shadow, and margin of an element are applied when the element’s box is fragmented. Fragmentation happens when content is split across lines, columns, or printed pages.
By default, browsers use slice, which treats decorations as if the box were never broken. With clone, each fragment gets its own full set of decorations — useful for pill-shaped highlights, badges, and bordered text that wraps cleanly.
💡
Beginner Tip
Think of slice as one sticker stretched across pieces of paper, and clone as printing a separate sticker on every piece.
Foundation
📝 Syntax
The syntax for box-decoration-break is simple — it accepts one of two keyword values:
The box-decoration-break property accepts exactly two keyword values. Each changes how decorations render across fragments.
Value
Example
Meaning
slice
box-decoration-break: slice;
Decorations are continuous across fragments, as if the box were not broken.
clone
box-decoration-break: clone;
Each fragment gets its own background, padding, border, and border-radius.
slice — continuousclone — per fragment
Context
When Does Fragmentation Happen?
Fragmentation is not an everyday layout term, but you see it often in real pages. These are the most common situations where box-decoration-break matters:
Line wrapping — An inline <span> with a background wraps to the next line and splits into two visual pieces.
CSS columns — A paragraph or inline element flows from one column into the next inside a multi-column container.
Print and paged media — Content continues on the next printed page, breaking the element across pages.
Long highlighted text — Badges, labels, or search highlights that must look polished when they wrap.
Without clone, wrapped highlights often look like one flat band cut awkwardly at line or column edges. With clone, each piece looks like its own rounded box.
Preview
👀 Live Preview
Compare slice and clone in a two-column layout. Resize the window to see how decorations behave when text fragments.
slice
This paragraph uses box-decoration-break: slice. The background, padding, and border are treated as one continuous decoration across column breaks.
clone
This paragraph uses box-decoration-break: clone. Each column fragment gets its own background, padding, border, and rounded corners.
Hands-On
Examples Gallery
See slice and clone in multi-column layouts, inline highlights, and rounded badges.
📚 Multi-Column Layouts
When content flows across columns, box-decoration-break decides whether decorations stay continuous or repeat on each fragment.
Example 1 — slice vs. clone in Columns
This example from a multi-column layout shows the clearest difference between the two values.
columns-slice-clone.html
<style>.container{column-count:2;column-gap:20px;}.slice{box-decoration-break:slice;background:lightblue;padding:10px;border:2px solid blue;}.clone{box-decoration-break:clone;background:lightcoral;padding:10px;border:2px solid red;}</style><divclass="container"><pclass="slice">Uses slice — continuous decoration.</p><pclass="clone">Uses clone — each fragment is styled separately.</p></div>
Uses slice — continuous decoration across column breaks.
Uses clone — each fragment is styled separately.
How It Works
With slice, the browser paints one background and border as if the paragraph were a single box. With clone, each column fragment gets its own complete decoration.
✍️ Inline Text Highlights
Wrapped inline text is one of the most practical uses for clone, especially for search highlights and labels.
Example 2 — Wrapped Inline Highlight
Use clone so a highlighted phrase looks like separate rounded pills on each line.
inline-highlight.html
<style>.highlight{box-decoration-break:clone;-webkit-box-decoration-break:clone;background:#fef08a;padding:0.15em 0.35em;border-radius:0.25rem;}</style><p>
CSS lets you style
<spanclass="highlight">text that wraps onto multiple lines with a clean highlight on every line</span>.
</p>
CSS lets you style text that wraps onto multiple lines with a clean highlight on every line.
How It Works
Each wrapped line becomes its own fragment. clone repeats the yellow background and rounded corners on every fragment instead of stretching one flat band across lines.
Example 3 — Border Radius on Wrapped Text
Compare how rounded corners behave with slice versus clone when text wraps.
radius-slice-clone.html
<style>.tag{padding:0.2em 0.5em;border:2px solid #7c3aed;border-radius:999px;background:#ede9fe;}.tag--clone{box-decoration-break:clone;-webkit-box-decoration-break:clone;}</style><p><spanclass="tag tag--clone">New feature badge that wraps cleanly</span></p>
Pill-shaped borders look best with clone. Without it, rounded corners may only appear on the outer edges of the whole fragmented box, not on each line.
🎨 Backgrounds & Gradients
Gradients and shadows also follow the same slice-or-clone rules when a box breaks apart.
Example 4 — Gradient Across Fragments
See how a gradient background behaves differently depending on the break mode.
gradient-fragments.html
<style>.gradient-clone{box-decoration-break:clone;-webkit-box-decoration-break:clone;background:linear-gradient(90deg, #bfdbfe, #ddd6fe);padding:0.25em 0.45em;border-radius:0.35rem;}</style><pstyle="max-width: 12rem;"><spanclass="gradient-clone">Gradient highlight that repeats on each wrapped line</span></p>
Gradient highlight that repeats on each wrapped line
How It Works
With clone, the gradient restarts on each fragment. With slice, one gradient would stretch across all fragments as a single decoration.
🧠 How box-decoration-break Works
1
The box breaks into fragments
Text wraps, columns split content, or a page break divides the element into separate visual pieces.
Fragmentation
2
You choose slice or clone
Set box-decoration-break to control whether decorations stay unified or repeat per fragment.
CSS rule
3
The browser paints decorations
Backgrounds, borders, padding, border-radius, and shadows are drawn either continuously or independently on each piece.
Rendering
=
🖼
Polished fragmented styling
Wrapped highlights and column text look intentional instead of awkwardly sliced.
Compatibility
Universal Browser Support
The box-decoration-break property is supported in all modern browsers. Include -webkit-box-decoration-break for reliable results in WebKit-based browsers.
✓ Baseline · Modern browsers
Style fragmented boxes in today’s browsers
Chrome, Firefox, Safari, Edge, and Opera support box-decoration-break in current versions. Use the WebKit prefix alongside the standard property when targeting older Safari.
96%Modern browser support
Google Chrome22+ · Desktop & Mobile
Full support
Mozilla Firefox32+ · Desktop & Mobile
Full support
Apple Safari7+ · macOS & iOS
Prefix recommended
Microsoft Edge79+ · Chromium
Full support
Opera15+ · Modern versions
Full support
Prefix tip
Add -webkit-box-decoration-break next to the standard property for consistent Safari results.
💻
Internet ExplorerNo support · Decorations use default slice behavior
None
box-decoration-break property96% supported
Bottom line: Use box-decoration-break freely in modern projects. Pair it with the WebKit prefix when Safari polish matters.
Wrap Up
Conclusion
The box-decoration-break property gives you control over how box decorations are applied to fragmented elements. Whether you want a continuous look with slice or distinct decorations for each fragment with clone, this property helps you achieve the visual effect you need.
Experiment with slice and clone in multi-column layouts and wrapped inline text to see how they can enhance the presentation of your content.
Use clone for wrapped inline highlights and pill-shaped badges
Include -webkit-box-decoration-break alongside the standard property
Test in narrow viewports where text wraps most often
Use slice when you want one continuous gradient or border
Combine with border-radius and padding for polished labels
❌ Don’t
Expect visible effects on elements that never fragment
Forget that the default value is slice, not clone
Assume every decoration behaves identically in every browser
Overuse heavy box-shadow on many cloned fragments — it can look busy
Skip testing in Safari when rounded wrapped highlights are important
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about box-decoration-break
Use these points when styling text that wraps or spans columns.
5
Core concepts
🖼01
Fragment Control
Styles broken boxes.
Purpose
✂02
slice Default
Continuous decorations.
Default
📋03
clone Value
Repeat per fragment.
Keyword
📄04
Wrap & Columns
Common break scenarios.
Context
🌈05
WebKit Prefix
Safari compatibility.
Tip
❓ Frequently Asked Questions
It controls how background, padding, border, border-radius, and box-shadow are drawn when an element is split into multiple fragments — for example when text wraps to a new line or content flows across columns.
slice treats the element as one continuous box, so decorations span all fragments as if nothing was broken. clone draws a full decoration set on each fragment independently, like separate mini boxes.
The initial value is slice. If you do not set the property, the browser uses slice behavior.
Common cases include inline text wrapping across lines, content split by CSS columns, and paged media such as print layouts. Any time one element becomes multiple visual fragments, this property matters.
Modern browsers support the standard property. For older WebKit browsers, you may also include -webkit-box-decoration-break alongside box-decoration-break for better compatibility.