Style backgroundClip 属性
定义和用法
background-clip 属性设置或返回背景的绘制区域。
浏览器支持
表中的数字表示支持该属性的第一个浏览器版本。
| 属性 | |||||
|---|---|---|---|---|---|
| backgroundClip | 4.0 | 9.0 | 4.0 | 3.0 | 10.5 |
语法
返回 backgroundClip 属性:
object.style.backgroundClip
设置 backgroundClip 属性:
object.style.backgroundClip = "border-box|padding-box|content-box|initial|inherit"
属性值
| 值 | 描述 |
|---|---|
| border-box | 默认值。背景按边界框进行剪裁。 |
| padding-box | 背景按填充框进行剪裁。 |
| content-box | 背景按内容框进行剪裁。 |
| initial | 设置该属性为它的默认值。请参阅 initial |
| inherit | 从父元素继承该属性。请参阅 inherit |
技术细节
| 默认值: | border-box |
|---|---|
| 返回值: | 字符串,表示元素的 background-clip 属性。 |
| CSS 版本 | CSS3 |
相关页面
CSS 参考手册: background-clip 属性
❮ Style 对象
