CSS透明边框属性background-clip引用有什么技巧
发布时间:2023-09-21 14:36:11 所属栏目:语言 来源:
导读:本篇文章主要介绍了css 透明边框background-clip妙用,分享给大家,也给自己留个笔记
<div class="border"></div>
.border {
width: 300px;
height: 300px;
background: url("https
<div class="border"></div>
.border {
width: 300px;
height: 300px;
background: url("https
本篇文章主要介绍了css 透明边框background-clip妙用,分享给大家,也给自己留个笔记 <div class="border"></div> .border { width: 300px; height: 300px; background: url("https://waiqin.oss-cn-shenzhen.aliyuncs.com/jxb-vip-ts/activitys/activitys15677540269589timg.jpg"); background-size: cover; margin-left: 100px; border: 10px solid rgba(255,255,255,.6); background-clip: padding-box; } background-clip: padding-box; 重点代码 background-clip 这个属性的初始值是 border-box,意味着背景会被元素的 border box(边框的外沿框)裁切掉。如果不希望背景侵入边框所在的范围,我们要做的就是把它的值设为 padding-box,这样浏览器就会用内边距的外沿来把背景裁切掉 (编辑:聊城站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐