Mask-border-repeat - CSS Property
Summary of characteristics of the mask-border-repeat property
SVG: containers except defs, graphic elements, use.
stretch | repeat | round | spacestretchDiscrète: during an animation, the mask-border-repeat property passes from one value to another without transition.Per grammar: serialization in the order of syntax.Syntax diagram of mask-border-repeat.
mask-border-repeat property.The links in the diagram provide more details about the values.
Download the diagram.
Description of the mask-border-repeat property.
mask-border-repeat is not yet supported by browsers. However, there is a non-standard property equivalent to mask-border-repeat
on almost all browsers: -webkit-mask-box-image-repeat, except on where there is no equivalent.
Border masking involves applying a mask to the edge of the element. The mask is an image made up of nine areas: four for the corners, four for the edges,
and a central part for the middle of the element. This division is done using the mask-border-slice property.
The parts related to the edges usually don't have the same dimensions as the element to be masked. The mask-border-repeat property indicates what
to do in these cases: stretch, repeat, etc. Here's a mask; the dark parts are the ones that need to be enlarged or repeated to fit the size of the
element. The corner parts of the mask don't need to be changed.

The areas of the mask affected
by mask-border-repeat.
Here are the properties that play a role in edges masks:
mask-border-repeat :Values for mask-border-repeat.
- mask-border-repeat: stretch;
With the
stretchvalue, the parts of the mask that need to be enlarged are stretched to cover the entire element.
mask-border-repeat:stretch;
-webkit-mask-box-image-repeat:stretch; - mask-border-repeat: repeat;
The
repeatvalue causes the relevant parts of the mask to repeat. There’s no scaling of the mask. You can see this in our example near the corners.
mask-border-repeat:repeat;
-webkit-mask-box-image-repeat:repeat; - mask-border-repeat: round;
The
roundvalue repeats the relevant parts of the mask by adjusting their dimensions so that there is a whole number of repetitions on each edge of the element.
mask-border-repeat:round;
-webkit-mask-box-image-repeat:round; - mask-border-repeat: space;
Finally, the
spacevalue repeats parts of the mask by adding spaces between these parts when the element's dimensions are not an exact multiple of the mask's dimensions. These added spaces are transparent, so the element disappears in those areas.
mask-border-repeat:space;
-webkit-mask-box-image-repeat:space; - mask-border-repeat: space stretch;
You can specify two values. The first one is for the horizontal edges, and the second one for the vertical edges. However, it’s not possible to apply a different repeating mode between the top and the bottom, or between the left and the right.

mask-border-repeat:space stretch;
-webkit-mask-box-image-repeat:space stretch; - mask-border-repeat: initial; (
stretch) mask-border-repeat: inherit; mask-border-repeat: revert; mask-border-repeat: revert-layer; mask-border-repeat: revert-rule; mask-border-repeat: unset;See the following pages for more details:
initial,inherit,revert,revert-layer,revert-rule,unset.
Animation of the mask-border-repeat property.
The animation of the property mask-border-repeat is necessarily discrete: the property accepts predefined non-numeric values. Since the standard property
is not yet supported by browsers, we had to use the non-standard property -webkit-mask-box-image-repeat.
⚠ Animations don’t work in Firefox.
Simulator.
For now, only the property works (and not even on ). But in a little while, we can hope that
the standard property mask-border-repeat will be functional.
Browsers compatibility with mask-border-repeat.
Browsers still don't handle the edges masking technique (2026) in a standard way. On some browsers, you can use the non-standard property
instead of mask-border-repeat. On , there is no equivalent.
mask-border-repeat to define the repetition mode of the parts of the mask.Notes:
(1) These browsers do not recognize the property mask-border-repeat. Use -webkit-mask-box-image-repeat instead.
mask-border-repeatproperty
Browsers on computers :
Mobile browsers :
Outdated or marginal browsers :

Internet Explorer

UC Browser pour Androïd

Opéra Mobile

QQ Browser

Baidu Browser

Samsung Internet

Chrome

Edge

Chrome pour Androïd

Androïd Brower

Firefox pour Androïd

Safari

Safari sur IOS

Firefox

KaiOS Browser

Opéra

Opéra mini
Historic of the mask-border-repeat property.
-
CSS Masking Module Level 1
This specification module describes two ways to partially or completely hide portions of visual elements: masking and clipping.
Masking involves using another graphic element or an image as a mask.
Clipping describes the visible region of visual elements. The region can be described using certain SVG graphic elements or simple shapes. Anything outside this region is not rendered.Regardingmask-border-repeatIntroduction of the propertymask-border-repeatand other properties related to border masks.November 15, 2012Working Draft.August 26, 2014Candidate Recommendation.
See also, about masking techniques.
The W3C specification that standardizes everything about border clipping or masking is called CSS Masking Module.
The mask-border-repeat property is described there, as well as the ones below:
Properties:













