border-image-repeat
Quick Summary for border-image-repeat
border-image-repeat
CSS property defines how the edge regions of a source image are adjusted to fit the dimensions of an element's border image.
Code Usage for border-image-repeat
/* Keyword value */ border-image-repeat: stretch; border-image-repeat: repeat; border-image-repeat: round; border-image-repeat: space; /* vertical | horizontal */ border-image-repeat: round stretch; /* Global values */ border-image-repeat: inherit; border-image-repeat: initial; border-image-repeat: revert; border-image-repeat: unset;
More Details for border-image-repeat
border-image-repeat
The border-image-repeat
CSS property defines how the edge regions of a source image are adjusted to fit the dimensions of an element's border image.
Syntax
/* Keyword value */ border-image-repeat: stretch; border-image-repeat: repeat; border-image-repeat: round; border-image-repeat: space; /* vertical | horizontal */ border-image-repeat: round stretch; /* Global values */ border-image-repeat: inherit; border-image-repeat: initial; border-image-repeat: revert; border-image-repeat: unset;
The border-image-repeat
property may be specified using one or two values chosen from the list of values below.
Values
stretch
The source image's edge regions are stretched to fill the gap between each border.
repeat
The source image's edge regions are tiled (repeated) to fill the gap between each border. Tiles may be clipped to achieve the proper fit.
round
The source image's edge regions are tiled (repeated) to fill the gap between each border. Tiles may be stretched to achieve the proper fit.
space
The source image's edge regions are tiled (repeated) to fill the gap between each border. Extra space will be distributed in between tiles to achieve the proper fit.
Formal definition
Initial value | stretch |
---|---|
Applies to | all elements, except internal table elements when border-collapse is collapse . It also applies to ::first-letter . |
Inherited | no |
Computed value | as specified |
Animation type | discrete |
Formal syntax
[ stretch | repeat | round | space ]{1,2}
Examples
Repeating border images
CSS#bordered { width: 12rem; margin-bottom: 1rem; padding: 1rem; border: 40px solid; border-image: url("border.png") 27; border-image-repeat: stretch; /* Can be changed in the live sample */ }
ResultsSpecifications
Specification |
---|
CSS Backgrounds and Borders Module Level 4 # the-border-image-repeat |
See also
Backgrounds and borders Learn CSS: Backgrounds and bordersLast modified: Aug 12, 2021, by MDN contributors
Select your preferred language English (US)DeutschEspañolFrançais日本語한국어Русский中文 (简体) Change language