CSS 属性

CSS border-image-source属性指定将用作元素边框的图像的路径。

属性值

  • none − 表示不使用图像作为边框。

  • image − 表示要用作边框的图像的路径。

  • initial: 它将默认值设置为属性。

  • inherit: 它从父元素继承属性。

适用范围

所有 HTML 元素。

DOM 语法

object.style.borderImageSource = url('image'); 

示例

这里是示例显示了此属性的效果 -

<html>
<head>
   <style>
   .box {
            width: 200px;
            height: 200px;
            border: 20px solid;
            border-image-source: url(/css/images/border.png);
            border-image-slice: 33%;
        }
   </style>
</head>
<body>
        <div class="box"></div>
</body>
</html>