Definition and Usage
The border-image-width CSS property defines the offset to use for dividing the border image in nine parts, the top-left corner, central top edge, top-right-corner, central right edge, bottom-right corner, central bottom edge, bottom-left corner, and central right edge. They represent inward distance from the top, right, bottom, and left edges.
- Initial 1
- Applies to all elements, except table elements when border-collapse is collapse
- Inherited no
- Percentages refer to the width or height of the border image area
- Media visual
- Computed Value all lengths made absolute, otherwise as specified
- Animatable no
- Canonical order the unique non-ambiguous order defined by the formal grammar
Syntax
Formal syntax: [ <length> | <percentage> | <number> | auto ]{1,4}
border-image-width: all /* One-value syntax */ E.g. border-image-width: 3; border-image-width: vertical horizontal /* Two-value syntax */ E.g. border-image-width: 2em 3em; border-image-width: top horizontal bottom /* Three-value syntax */ E.g. border-image-width: 5% 15% 10%; border-image-width: top right bottom left /* Four-value syntax */ E.g. border-image-width: 5% 2em 10% auto; border-image-width: inherit
where:
- width
- Is a value denoting the width of the image used as a border to apply to all four edges. It is used only in the one-value syntax.
- vertical
- Is a value denoting the width of the image used as a border to apply to all vertical edges, that is the top and bottom edges. It is used only in the two-value syntax.
- horizontal
- Is a value denoting the width of the image used as a border to apply to all horizontal edges, that is the right and left edges. It is used only in the two- and three-value syntaxes.
- top
- Is a value denoting the width of the image used as a border to apply to the top edge. It is used only in the three- and four-value syntaxes.
- bottom
- Is a value denoting the width of the image used as a border to apply to the bottom edge. It is used only in the three- and four-value syntaxes.
- right
- Is a value denoting the width of the image used as a border to apply to the top edge. It is used only in the four-value syntax.
- left
- Is a value denoting the width of the image used as a border to apply to the top edge. It is used only in the four-value syntax.
-
inherit
- Is a keyword indicating that all four values are inherited from their parent's element calculated value.
Values
- <length>
- Represents the length of the image slice. It can be an absolute or relative length. This length must not be negative.
- <percentage>
- Represents the percentage of the image slice relative to the height, or width, of the border image area. The percentage must not be negative.
- <number>
- Represents a multiple of the computed value of the element's border-width property to be used as the image slice size. The number must not be negative.
- auto
- Indicates that the width, or height, of the image size must be the intrinsic size of that dimension.
Examples
No examplesCompatibility
Desktop browsers
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 15.0 | 13.0 (13.0) | Not supported | Not supported | Not supported |
Mobile browsers
Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | NA | 13.0 (13.0) | Not supported | NA | NA |