Web速查-索引

Alt text

定义

border-image-repeat 属性规定图像边框是否应该被重复(repeated)、拉伸(stretched)或铺满(rounded)。

注意:该属性规定如何延展和铺排边框图像的边缘和中间部分。因此,可以规定两个值。如果省略第二个值,则采取与第一个值相同的值。

语法

border-image-repeat: stretch|repeat|round;

属性值

说明
stretch 拉伸图像来填充区域
repeat 平铺(重复)图像来填充区域。
round 类似 repeat 值。如果无法完整平铺所有图像,则对图像进行缩放以适应区域。

实例

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>鱼C-零基础入门学习Web(Html5+Css3)</title>
<style>
div {
background-color: lightgrey;
border: 30px solid transparent;
border-image: url(../img/logo.png);
border-image-slice: 30;
border-image-repeat: repeat;
}
</style>
</head>
<body>
<div>
DIV 使用图像边框。
</div>
<p>使用的图片:</p>
<img src="../img/logo.png">
<p><b>注意: </b>Internet Explorer 10, Opera 12, 和 Safari 5 不支持 border-image-repeat 属性。</p>
</body>
</html>
DIV 使用图像边框。

使用的图片:

注意: Internet Explorer 10, Opera 12, 和 Safari 5 不支持 border-image-repeat 属性。

浏览器支持

表格中的数字表示支持该属性的第一个浏览器版本号

Safari Chrome FireFox IE
6.0 3.0 4.0 9.0