Summary
The border-image-repeat
CSS property defines how the middle part of a border image is handled so that it can match the size of the border. It has a one-value syntax that describes the behavior of all the sides, and a two-value syntax that sets a different value for the horizontal and vertical behavior.
Initial value | stretch |
---|---|
Applies to | all elements, except internal table elements when border-collapse is collapse . It also applies to ::first-letter . |
Inherited | no |
Media | visual |
Computed value | as specified |
Animatable | no |
Canonical order | the unique non-ambiguous order defined by the formal grammar |
Syntax
/* border-image-repeat: type */ border-image-value: stretch; /* border-image-repeat: horizontal vertical */ border-image-width: round stretch; /* Global values */ border-image-repeat: inherit; border-image-repeat: initial; border-image-repeat: unset;
Values
- type
- One of the
stretch
,repeat
, orround
keywords denoting how the image is treated both horizontally and vertically. - horizontal
- One of the
stretch
,repeat
, orround
keywords denoting how the image is treated horizontally. - vertical
- One of the
stretch
,repeat
, orround
keywords denoting how the image is treated vertically. stretch
- Keyword indicating that the image must be stretched to fill the gap between the two borders.
repeat
- Keyword indicating that the image must be repeated until it fills the gap between the two borders.
round
- Keyword indicating that the image must be repeated until it fills the gap between the two borders. If the image doesn't fit after being repeated for an integral number of times, the image is rescaled to fit.
space
- The image is tiled (repeated) to fill the area. If it does not fill the area with a whole number of tiles, the extra space is distributed around the tiles.
Formal syntax
[ stretch | repeat | round | space ]{1,2}
Examples
See border-image
for examples of what repeat values will do.
Specifications
Specification | Status | Comment |
---|---|---|
CSS Backgrounds and Borders Module Level 3 The definition of 'border-image-repeat' in that specification. |
Candidate Recommendation | Initial definition |
Browser compatibility
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 15.0 | 15.0 (15.0) | 11 | 15 | 6[1] |
space |
Not supported[1] | Not supported[3] | 11 | Not supported | 9.1[5] |
round |
30[4] | 15.0 (15.0) | 11 | ? | 9.1[5] |
Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | ? | 15.0 (15.0) | Not supported | ? | 9.3[5] |
[1] Support the space
value, but the actual effect is the same as the repeat
value.
[2] Support the round
value, but the actual effect is the same as the repeat value.
[3] See bug 720531.
[4] See Chrome bug.
[5] See WebKit bug.
See also
Document Tags and Contributors
Tags:
Contributors to this page:
fscholz,
yisibl,
ziyunfei,
Sebastianz,
Majr,
jsx,
teoli,
sboroda,
KuroTora,
kscarfone,
lobaluna,
davy.martinez,
paulami_banerjee,
LouisLazaris,
amycb,
Sheppy,
ethertank,
wlach,
trevorh,
brianloveswords
Last updated by:
fscholz,