小白教程
所有教程
关于
Search
172.69.6.208
172.69.6.208
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Css3 pr background clip”的源代码
本页内容
上一节:
Pr_background_repeat
下一节:
Css3_pr_background_origin
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:background-clip}}[[Category:css reference|45]] = CSS3 background-clip 属性 = 指定绘图区的背景: <sample title="" desc="" lang="html" hererun="1"> div { background-color:yellow; background-clip:content-box; } </sample> <run name=""> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>小白教程(xiaobai.wang)</title> <style> #example1 { border: 10px dotted black; padding:35px; background: yellow; } #example2 { border: 10px dotted black; padding:35px; background: yellow; background-clip: padding-box; } #example3 { border: 10px dotted black; padding:35px; background: yellow; background-clip: content-box; } </style> </head> <body> <p>没有背景剪裁 (border-box没有定义):</p> <div id="example1"> <h2>Lorem Ipsum Dolor</h2> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p> </div> <p>background-clip: padding-box:</p> <div id="example2"> <h2>Lorem Ipsum Dolor</h2> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p> </div> <p>background-clip: content-box:</p> <div id="example3"> <h2>Lorem Ipsum Dolor</h2> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p> </div> </body> </html> </run> == 浏览器支持 == 表格中的数字表示支持该属性的第一个浏览器版本号。 {| class="table table-striped table-hover" ! 属性 ! Chrome ! Internet Explorer / Edge ! Firefox ! Safari ! Opera |- | background-clip | 4.0 | 9.0 | 4.0 | 3.0 | 10.5 |} == 标签定义及使用说明 == background-clip属性指定背景绘制区域。 {| class="table table-striped table-hover" | 默认值: | border-box |- | 继承: | no |- | 版本: | CSS3 |- | JavaScript 语法: | object object.style.backgroundClip="content-box" |} == 语法 == <pre> background-clip: border-box|padding-box|content-box;</pre> {| class="table table-striped table-hover" ! 值 ! 说明 |- | border-box | 默认值。背景绘制在边框方框内(剪切成边框方框)。 |- | padding-box | 背景绘制在衬距方框内(剪切成衬距方框)。 |- | content-box | 背景绘制在内容方框内(剪切成内容方框)。 |} == 相关文章 == CSS3 教程: [[css3 backgrounds|CSS3 背景]]
返回至“
Css3 pr background clip
”。
上一节:
Pr_background_repeat
下一节:
Css3_pr_background_origin