CSS mask-border-repeat Property
Description
The mask-border-repeat property controls how the pieces produced by slicing a mask border image are laid out along an element’s border area. When a border mask image is divided into regions (corners and edges) the property determines the treatment of those edge regions as they are applied around the element — whether they are tiled, scaled, or otherwise fitted to fill the available border thickness and edge lengths. This behavior is limited to the border mask regions and does not alter the center region of the mask or the element’s main content mask.
In practice this property works together with the source and slicing that define the border mask: the image provided by mask-border-source is divided into corner and edge segments, and the repeat behavior governs how the edge segments fill the space between corners. Corners are preserved as discrete pieces, while edge segments are manipulated to cover varying border widths and edge lengths. Because the edge segments may be repeated or scaled to match the element’s geometry, you can see visual differences such as seams, scaling artifacts, or repetition patterns depending on the chosen fitting behavior and on the mask graphic itself.
From the rendering and compositing perspective, mask-border-repeat only influences how the border mask image is painted before it is applied as an alpha mask to the element; it does not change how the masked result is blended with backgrounds or overlays. The relationship with a simple mask image is relevant when you want a consistent masked appearance across an element: see mask-image for how non-border masks behave. The concept is analogous to how image-border slicing and tiling is controlled for ordinary borders — compare to border-image-repeat — so many of the same visual considerations (tiling seams, scaling distortion, and performance implications of many repeated tiles) apply when deciding how to use the property.
Definition
- Initial value
- stretch
- Applies to
- all elements; In SVG, it applies to container elements excluding the <defs> element and all graphics elements
- Inherited
- no
- Computed value
- as specified
- Animatable
- yes
- JavaScript syntax
- object.style.maskBorderRepeat
Syntax
mask-border-repeat: <repeat-style> [ <repeat-style> <repeat-style> ]?;
Values
- stretchThe mask image is stretched to fill the border area.
- repeatThe mask image is repeated (tiled) to fill the border area.
- roundThe mask image is repeated, but scaled so that it fits an integer number of times.
- spaceThe mask image is repeated, and extra space is distributed evenly between the tiles.
Example
Browser Support
The following information will show you the current browser support for the CSS mask-border-repeat property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported in some modern browsers, but not all.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
