div
{
background-color:yellow;
background-clip:content-box;
}
![]()
![]()
![]()
![]()
![]()
Internet Explorer 9+, Firefox, Opera, Chrome, 和 Safari支持background-clip 属性。
注意: Internet Explorer 8 及 更早IE版本不支持background-clip 属性
background-clip属性指定背景绘制区域。
| 默认值: | border-box |
|---|---|
| 继承: | no |
| 版本: | CSS3 |
| JavaScript 语法: | object object.style.backgroundClip="content-box" |
background-clip: border-box|padding-box|content-box;| 值 | 说明 |
|---|---|
| border-box | 默认值。背景绘制在边框方框内(剪切成边框方框)。 |
| padding-box | 背景绘制在衬距方框内(剪切成衬距方框)。 |
| content-box | 背景绘制在内容方框内(剪切成内容方框)。 |
CSS3 教程: CSS3 Backgrounds