--- title: border-image-width slug: Web/CSS/border-image-width translation_of: Web/CSS/border-image-width ---
he border-image-width
CSS property defines the width of the border image by defining inward offsets from the border edges. If the border-image-width
is greater than the {{cssxref("border-width")}}, then the border image extends beyond the padding (and/or content) edge.
{{cssinfo}}
/* border-image-width: all */ border-image-width: 3; /* border-image-width: vertical horizontal */ border-image-width: 2em 3em; /* border-image-width: top horizontal bottom */ border-image-width: 5% 15% 10%; /* border-image-width: top right bottom left */ border-image-width: 5% 2em 10% auto; /* Global values */ border-image-width: inherit; border-image-width: initial; border-image-width: unset;
где:
inherit
<length>
<percentage>
<number>
auto
{{csssyntax}}
<!DOCTYPE html> <html> <head></head> <body> <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p> </body> </html>
p { border-image-source: url("https://mdn.mozillademos.org/files/10470/border.png"); border-image-slice: 30; border-image-width: 20px; border-image-repeat: round; padding: 40px; }
{{ EmbedLiveSample('Examples', '480', '320', '', 'Web/CSS/border-image-width') }}
Specification | Status | Comment |
---|---|---|
{{SpecName('CSS3 Backgrounds', '#border-image-width', 'border-image-width')}} | {{Spec2('CSS3 Backgrounds')}} | Initial definition |
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 15.0 | {{CompatGeckoDesktop("13.0")}} | 11 | 15 | 6 |
Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | {{CompatUnknown}} | {{CompatGeckoMobile("13.0")}} | {{CompatNo}} | {{CompatUnknown}} | {{CompatUnknown}} |