HTML Dog
跳至导航

CSS 属性:border-image-repeat

边框图像平铺。边框图像的各部分如何缩放和平铺。

可能的值

描述示例
stretch拉伸图像以适应区域。默认行为。
repeat平铺。水平和垂直方向重复图像。
round图像重复但实例不会被裁剪。每个实例都会拉伸以填充背景区域,直到新的实例可以容纳为止。
space图像重复但实例不会被裁剪。均匀的间隙会间隔开每个实例,直到新的实例可以容纳为止。
[值] [值]第一个值应用于水平边。第二个值应用于垂直边。stretch repeat
inherit
initial
unset

示例


aside {
    border: 10px solid fuchsia;
    border-image-source: url("fluffy.png");
    border-image-slice: 25 fill;
    border-image-repeat: repeat;
}
/* Sets "fluffy.png" as the border image on a 10-pixel wide border with a solid fuchsia-colored fallback.
   Image is sliced up.
   Instead of stretching (the default behavior), border image sides are repeated. */

浏览器支持

Can I Use border-image? 来自 caniuse.com 的关于 border-image 功能在主流浏览器中的支持情况的数据。