css3图像边框:border-image-代码篇css3图⽚边框:border-image的应⽤,含效果图
⼀、这是我使⽤的图⽚:
效果图如下:
部分css代码如下:
border radius什么意思/*⽂字卡⽚ vip-border*/
.vip-border{border-radius: 0;box-shadow: none;
border:15px solid transparent;
box-sizing: border-box;
/*边框图⽚兼容处理*/
-moz-border-image:url(../images/vip-border.png) 30 30 round; /* Old Firefox */
-webkit-border-image:url(../images/vip-border.png) 30 30 round; /* Safari and Chrome */
-o-border-image:url(../images/vip-border.png) 30 30 round; /* Opera */
border-image:url(../images/vip-border.png) 30 30 round;
}
⼆、demo 附件:
1. 效果图:
2. 演⽰代码 · 如下:
<!DOCTYPE html>
<html>
<head>
<style>
div{
border:15px solid transparent;
width:300px;
padding:10px 20px;
}
#round{
-moz-border-image:url(/i/border.png) 30 30 round; /* Old Firefox */
-webkit-border-image:url(/i/border.png) 30 30 round; /* Safari and Chrome */ -o-border-image:url(/i/border.png) 30 30 round; /* Opera */
border-image:url(/i/border.png) 30 30 round;
}
#stretch{
-moz-border-image:url(/i/border.png) 30 30 stretch; /* Old Firefox */
-webkit-border-image:url(/i/border.png) 30 30 stretch; /* Safari and Chrome */ -o-border-image:url(/i/border.png) 30 30 stretch; /* Opera */
border-image:url(/i/border.png) 30 30 stretch;
}
</style>
</head>
<body>
<div id="round">在这⾥,图⽚铺满整个边框。</div>
<div id="stretch">在这⾥,图⽚被拉伸以填充该区域。</div>
<p>这是我们使⽤的图⽚:</p>
<img src="/i/border.png">
<p><b>注释:</b> Internet Explorer 不⽀持 border-image 属性。</p>
<p>border-image 属性规定了⽤作边框的图⽚。</p>
</body>
</html>
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论