CSS background-clip

128次阅读
没有评论

共计 542 个字符,预计需要花费 2 分钟才能阅读完成。

css background-clip 定义与用法

background-clip 属性指定背景绘制区域。

默认值: border-box
继承: no
版本: CSS3
JavaScript 语法: object object.style.backgroundClip="content-box"

 

css background-clip 语法

background-clip: border-box|padding-box|content-box;

 

说明
border-box 默认值。背景绘制在边框方框内(剪切成边框方框)。
padding-box 背景绘制在衬距方框内(剪切成衬距方框)。
content-box 背景绘制在内容方框内(剪切成内容方框)。

 

css background-clip 浏览器支持

CSS background-clipCSS background-clipCSS background-clipCSS background-clipCSS background-clip

Internet Explorer 9+, Firefox, Opera, Chrome, 和 Safari 支持 background-clip 属性。

注意: Internet Explorer 8 及 更早 IE 版本不支持 background-clip 属性

 

css background-clip 实例

指定绘图区的背景:

div
{
background-color:yellow;
background-clip:content-box;
}

在线运行

 

正文完