CSS 属性

CSS border-image-width设置为元素边框的图像的宽度。

属性值

  • length: 任意长度指定宽度的单位值(以像素为单位)。

  • number: 它表示 border-width 倍数,默认值为 1。

  • 百分比 (%): 指边框图像区域的大小。

  • auto: 指定为相应图像切片的内部宽度或高度。

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

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

适用范围

所有 HTML 元素.

DOM 语法

object.style.borderImageWidth = "10px"; 

示例

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

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