border-image: none 100% 1 0 stretch
border-image: source slice width outset repeat | initial | inherit;
值 | 说明 |
border-image-source: | 它指定边框图像的来源。它设置图像的路径,或者可以说它指定了要用作边框的图像的位置。 |
border-image-slice: | 它用于对图像进行分割或切片,该图像由 border-image-source 属性指定。此属性的值指定如何对图像进行切片以创建边框。此属性将图像分为九个部分: 四个角落 四条边, 一个中心 可以接受四个无单位的正值。其默认值为 100%。 |
border-image-width: | 它设置边框图像的宽度。它可以接受无单位的正值,百分比值或关键字auto。其默认值为 1 。我们最多可以指定四个值来提供各个边的宽度。 |
border-image-outset: | 它设置了从边框框中显示边框图像的空间量。 |
border-image-repeat: | 它控制图像的重复以填充边框区域。我们最多可以为此属性指定两个值。如果我们指定一个值,那么它将同时应用于垂直和水平方向。但是,如果我们指定两个值,则第一个值应用于水平边,第二个值应用于垂直边。 此属性的值在下面列出。 stretch repeat round space 此属性的默认值为 stretch 。 |
Initial | 它将属性设置为其默认值(边框图像:无100%1 0 Stretch)。 |
inherit | 它从其父元素继承属性。 |
<!DOCTYPE html>
<html>
<head>
<title>
CSS border-image Property
</title>
<style>
p {
border: 10px solid transparent;
padding: 15px;
text-align: center;
font-size: 25px;
color: darkviolet;
}
#border {
border-image: url('border.png') 60 / 20px 20px round;
}
#border1 {
border-image: url('diamond.png') 43 / 10px 15px round stretch;
}
</style>
</head>
<body>
<h2>border-image property</h2>
<p id="border">
Welcome to the bianchenghao6.com
</p>
<p id="border1">
Welcome to the bianchenghao6.com
</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>
CSS border-image Property
</title>
<style>
p {
border: 10px solid transparent;
padding: 15px;
text-align: center;
font-size: 25px;
color: darkviolet;
}
#border {
border-image: url('../uploads/html/border.jpg') 40 round stretch;
}
#border1 {
border-image: linear-gradient(orange, yellow, green) 40 / 30px 10px stretch;
}
#border2 {
border-image: repeating-linear-gradient(50deg, blue, yellow, lightgreen 20px) 30 / 20px 30px round;
}
</style>
</head>
<body>
<h2>border-image property</h2>
<p id="border">
Welcome to the bianchenghao6.com
</p>
<p id="border1">
Welcome to the bianchenghao6.com
</p>
<p id="border2">
Welcome to the bianchenghao6.com
</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>
CSS border-image Property
</title>
<style>
p{
border: 10px solid transparent;
padding: 15px;
text-align:center;
font-size: 25px;
color: darkviolet;
}
#border1 {
border-image: radial-gradient(circle, yellow, magenta, blue) 30 / 15px repeat;
}
#border2 {
border-image: radial-gradient(farthest-side, red, yellow, green) 30 / 15px round;
}
</style>
</head>
<body>
<h2>border-image property</h2>
<p id = "border1">
Welcome to the bianchenghao6.com
</p>
<p id = "border2">
Welcome to the bianchenghao6.com
</p>
</body>
</html>