Skip to content

box-decoration-break ​

描述 ​

该 box-decoration-break 属性指定当分隔符(页面/列/区域/行)拆分框时,该属性控制:

  1. 盒子的边距、边框、填充物和其他装饰是否包裹了盒子碎片的断边。
  2. 背景定位区域是如何从盒子碎片中派生出来的,以及如何在其中绘制元素的背景。

效果展示 ​

语法 ​

css
box-decoration-break: slice | clone;

值 ​

  • slice 在中断处不插入边框和填充;在断边处不绘制框形阴影;边框半径不适用于其角;并且为整个盒子渲染背景和边框图像,就好像盒子没有损坏一样。
  • clone 每个盒子碎片都用边框和填充独立包裹。边框半径、边框图像和框阴影(如果有)将独立应用于每个片段。背景在元素的每个片段中独立绘制。

注意事项 ​

  1. 没有碎片的块元素会导致

    A screenshot of the rendering of the block element used in the examples without any fragmentation.

  2. 将上述块分成三列会导致:A screenshot of the rendering of the fragmented block used in the examples styled with box-decoration-break.