详解:44 background-clip
【摘要】
//裁剪成白色哈,border的属性比如solid之类的不会裁剪。
<!DOCTYPE html>
<html lang="en">
<head>
<meta...
//裁剪成白色哈,border的属性比如solid之类的不会裁剪。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>background-clip</title>
<link rel="stylesheet" type="text/css" href="css/reset.css"/>
<style type="text/css">
div{
width: 200px;
height: 100px;
border:20px dashed rgba(0,0,0,.8);
background:url(images/king.jpg) no-repeat pink;
padding:30px;
margin:20px;
}
.box1{
background-clip:border-box;/*border以外的部分裁剪*/
}
.box2{
background-clip:padding-box;//padding以外的
}
.box3{
background-clip:content-box;
}
</style>
</head>
<body>
<div class="box1">box1</div>
<div class="box2">box2</div>
<div class="box3">box3</div>
</body>
</html>
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
文章来源: blog.csdn.net,作者:贵哥的编程之路(陈业贵),版权归原作者所有,如需转载,请联系作者。
原文链接:blog.csdn.net/qq_37805832/article/details/107588134
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)