我使用 CSS 创建了一个三角形,效果很好。现在我想使用图像而不是颜色作为边框,但它不起作用。我只想要边框图像border-top
。
这是原始的CSS:
.triangle-down
{
position:absolute;
width: 0;
height: 0;
border-left: 87px solid transparent;
border-right: 87px solid transparent;
border-top: 150px solid #14A2E0;
}
修改 CSS 以使用图像:
.triangle-down
{
position:absolute;
width: 0;
height: 0;
border-left: 87px solid transparent;
border-right: 87px solid transparent;
border-top: 150px solid;
-moz-border-image:url(border.png) 30 30 round; /* Old Firefox */
-webkit-border-image:url(border.png) 30 30 round; /* Safari */
-o-border-image:url(border.png) 30 30 round; /* Opera */
border-image:url(border.png) 30 30 round;
}
JSFiddle:http: //jsfiddle.net/MnPLh/