box-decoration-break

Các utility để kiểm soát cách các fragment phần tử nên được render trên nhiều dòng, cột hoặc trang.

ClassStyles
box-decoration-clone
box-decoration-break: clone;
box-decoration-slice
box-decoration-break: slice;

Ví dụ

Ví dụ cơ bản

Sử dụng các utility box-decoration-slicebox-decoration-clone để kiểm soát việc các thuộc tính như background, border, border-image, box-shadow, clip-path, margin và padding nên được render như thể phần tử là một fragment liên tục, hay các khối riêng biệt:

box-decoration-slice

Hello
World

box-decoration-clone

Hello
World
<span class="box-decoration-slice bg-linear-to-r from-indigo-600 to-pink-500 px-2 text-white ...">  Hello<br />World</span><span class="box-decoration-clone bg-linear-to-r from-indigo-600 to-pink-500 px-2 text-white ...">  Hello<br />World</span>

Thiết kế responsive

Prefix a box-decoration-break utility with a breakpoint variant like md: to only apply the utility at medium screen sizes and above:

<div class="box-decoration-clone md:box-decoration-slice ...">  <!-- ... --></div>

Learn more about using variants in the variants documentation.

Copyright © 2025 Tailwind Labs Inc.·Chính sách thương hiệu