时间:2021-07-01 10:21:17 帮助过:43人阅读

CSS3 border-image-repeat属性
作用:规定图像边框是否应该被重复(repeated)、拉伸(stretched)或铺满(rounded)。
语法:
border-image-repeat: stretch|repeat|round|space;
stretch:表示拉伸图像来填充区域
repeat:表示平铺(重复)图像来填充区域。
round:类似 repeat 值;如果无法完整平铺所有图像,则对图像进行缩放以适应区域。
space:类似 repeat 值。如果无法完整平铺所有图像,扩展空间会分布在图像周围
说明:border-image-repeat属性规定如何延展和铺排边框图像的边缘和中间部分。因此,您可以规定两个值。如果省略第二个值,则采取与第一个值相同的值。
注: Internet Explorer 10, Opera 12 和 Safari 5 不支持 border-image-repeat 属性。
CSS3 border-image-repeat属性的使用示例
<!DOCTYPE html>
<html>
<head>
<style>
div {
margin:50px;
border: 30px solid transparent;
border-image: url('https://img.php.cn/upload/article/000/000/024/5c62637b1a4fe853.png');
border-image-slice: 25;
}
.round{
border-image-repeat: round;
}
.repeat{
border-image-repeat: repeat;
}
.stretc{
border-image-repeat: stretc;
}
</style>
</head>
<body>
<div class="round">
DIV 使用图像边框--round
</div>
<div class="repeat">
DIV 使用图像边框--repeat
</div>
<div class="stretc">
DIV 使用图像边框--stretc
</div>
</body>
</html>效果图:

本文参考:https://www.html.cn/book/css/properties/border/border-image-repeat.htm
以上就是border-image-repeat属性怎么用的详细内容,更多请关注Gxl网其它相关文章!