English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

CSS reference manual

CSS @rules

CSS attributes大全

CSS3 border-image-Usage and examples of the width property

border-image-The width CSS property specifies the width of the border.

The following table provides the usage instructions and version history of this property, as well as the syntax for using it in JavaScript scripts.

Default value:1
Applies to:This property can be applied to any element, but when it comes to table elements (such as tr, th, td), the border-When the collapse attribute value is collapse, border-image-The width attribute is invalid. It also applies to::first-letter.
Inheritance:No
Can be animated:No.Please see Animation properties.
Version: CSS3new feature
JavaScript syntax:object.style.borderImageWidth="30 30"

border-image-The syntax of width usage

The syntax of this attribute is as follows:

border-image-width: [ length | percentage | number | auto ] 1 to 4 values | initial | inherit

The following examples demonstrate how to use border-image-width attribute.

.box {
    width: 300px;
    height: 150px;
    border-image-source: url("border.png");
    border-image-width: 10px;
    border-image-slice: 30;
    border-image-repeat: round;
}
Test and see‹/›

Attribute value

The following table describes the value of this attribute.

ValueDescription
lengthSpecify the border width in absolute or relative units.
percentageSpecify the border width in percentage of the element.
numberrepresents the elementborder-widthThe calculated value of the attribute or a multiple of the border width.
autoSpecify the border image width as the inherent width or height of the corresponding image slice.
initialSet this property to its default value.
inheritIf specified, the associated element uses its parent element's border-image-The calculated value of width attribute.

Browser compatibility

border-image-The compatibility of width attribute in browsers, the numbers in the table below represent the minimum version number of browsers that support this attribute; all mainstream browsers support this attribute.

  • Firefox 15+

  • Google Chrome15+

  • Internet Explorer 11+

  • Apple Safari 6+

  • Opera 15+

Read more

Please refer to the following tutorials:CSS3 BorderandCSS Border.

Related attributes:border-image,border-image-source,border-image-repeat,border-image-slice,border-image-outset,border.