CSS 属性:background-clip
背景(颜色或图像)绘制在框的哪个部分。
可能的值
| 值 | 描述 | 示例 |
|---|---|---|
border-box | 背景覆盖框的边框、内边距和内容区域。背景将显示在半透明(或完全透明)的边框后面。默认行为。 | |
padding-box | 背景覆盖框的内边距和内容区域。 | |
content-box | 背景覆盖框的内容区域。 | |
[值], [值] | 用于多重背景。用逗号分隔的值对应于使用 background-image 分隔的多个图片。 | padding-box, content-box |
inherit | ||
initial | ||
unset | ||
示例
article { background-clip: padding-box; }
/* Any article background will be painted behind the content and padding areas but not the border area. */
