Mask-border-source - CSS Property
Summary of characteristics of the mask-border-source property
SVG: containers except defs, graphic elements, use.
noneDiscrète: during an animation, the mask-border-source property passes from one value to another without transition.Single: single value (no order).Syntax diagram of mask-border-source.
mask-border-source property.The links in the diagram provide more details about the values.
Description of the mask-border-source property.
mask-border-source property is still not well recognized by browsers. On browsers based on webkit, there is an equivalent property
prefixed with -webkit-. That's -webkit-mask-box-source. On , there is no equivalent.
Edge masking involves hiding the outline of an element using a mask. This mask is an image divided into 9 parts: four for the corners, four for the sides, and one for the center of the element. The parts associated with the sides stretch or repeat to cover the length or width of the element. The transparent parts of the mask hide the element, while the opaque parts keep it visible, including all the variations linked to the mask's opacity. You can also create masks that work based on their brightness.
mask-border-source defines which image to use for the mask. If the image is missing or in an unrecognized format, the mask won't apply.
If a regular mask is also applied to the element (see the mask property for this), both masks are applied in any order, and the result is the
same regardless of the order.

Here are the properties that play a role in edge masks:
mask-border-source:Values for mask-border-source.
- mask-border-source: none;
No edge mask is applied.
- mask-border-source: url(...)
With this syntax
mask-border-sourcedefines which image will be used as a mask. To get the expected result, it will also be necessary to set the propertymask-border-sliceto explain how to divide the image into nine parts.Indeed, the chosen image will be divided into nine parts: one for each of the four corners, one for each of the four edges, and one for the central part of the element, as shown in the drawing below.

- mask-border-source: initial; (
none) mask-border-source: inherit; mask-border-source: revert; mask-border-source: revert-layer; mask-border-source: revert-rule; mask-border-source: unset;See the following pages for more details:
initial,inherit,revert,revert-layer,revert-rule,unset.
Animation of the mask-border-source property.
The mask-border-source property can be animated in a discrete way, meaning with a sudden jump from one value to another.
However, some browsers like , , etc., chain the images with a fade.
The example alternates between the two masks below.
The animation doesn't work in , and for other browsers, we used the non-standard property -webkit-mask-box-image-source.



Browsers compatibility with mask-border-source.
Browsers still don't handle edge masking techniques well enough (2026). in particular doesn't recognize any of the properties related to
edge masking. On other browsers, you can temporarily use the -webkit-mask-box-image-source property as a replacement for mask-border-sourceLib}.
mask-border-source which defines which mask to use for borders.Notes:
(1) The property is not yet recognized: use -webkit-mask-box-image-source instead.
mask-border-sourceproperty
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-source 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-sourceIntroduction of the propertymask-border-sourceas well as other properties related to border masking.November 15, 2012Working Draft.August 26, 2014Candidate Recommendation.
See also, about masking techniques.
The properties related to the edge mask are published in CSS Masking Module, just like the properties related to the classic masking of elements.
Properties:













