Mask-border-slice - CSS Property
Summary of characteristics of the mask-border-slice property
SVG: containers except defs, graphic elements, use.
fill0Discrète: during an animation, the mask-border-slice property passes from one value to another without transition.Per grammar: serialization in the order of syntax.Syntax diagram of mask-border-slice.
mask-border-slice property.The links in the diagram provide more details about the values.
Download the diagram.
In the diagram, the bold terms are the predefined words of CSS, the other terms are described below:
numberis a number without a unit.%is a percentage calculated based on the width or height of the element.
Description of the mask-border-slice property.
mask-border-slice property is for now poorly recognized by browsers. Sometimes there is an equivalent property: -webkit-mask-box-slice,
like on , , or , but on there is no equivalent.
Border masks involve hiding the border of an element using an image called the mask. It works like a regular mask, but the difference lies in how the mask is repeated.
The property mask-border-slice defines how to split the mask into nine parts, which will be used, for four of them, to cover the corners of the element,
four others to cover the sides, and the central part for the center of the element. These parts don’t necessarily have to be the same size. The parts
used for the sides can be stretched or repeated to cover the length or width of the element (see mask-border-repeat).
top left corner.
top right corner.
the left edge.

the right edge.
bottom left corner.
bottom right corner.
You can also check out these properties that are involved in edge masks:
mask-border-slice:Values for mask-border-slice.
- mask-border-slice: 120 110 115 130; a b c d
From one to four numbers without units, or percentages. These numbers must be positive or zero. They represent the distance from the top edge, the right edge, the bottom, and the left edge of the mask. This divides the mask into nine parts: four for the corners, four for the edges, and the central part for the middle of the element.
If there is only one value, it applies to all 4 sides. With two values, the first applies to the top and bottom of the mask, and the second to the right and left edges. With 3 values, the top is set by the first value, the right and left edges by the second, and the bottom by the third. Finally, with 4 values, each one applies to a different side of the mask.

A single value.
Two values.
Three values.
Four values.If we're talking about percentages, they are calculated relative to the mask's width for the
banddvalues, and relative to the height for the other two values. So the vertical values are calculated based on the height, and the horizontal values based on the width. - mask-border-slice: 120 110 115 130 fill;
This last parameter (
fill) indicates how the central part should behave. Iffillis specified, the central part of the mask affects the center of the element. Otherwise, the central part of the element is not displayed.
Withfill.
(simulation)
Withoutfill.
(simulation) - mask-border-slice: initial; (
0) mask-border-slice: inherit; mask-border-slice: revert; mask-border-slice: revert-layer; mask-border-slice: revert-rule; mask-border-slice: unset;See the following pages for more details:
initial,inherit,revert,revert-layer,revert-rule,unset.
Animation of the mask-border-slice property.
Animations don’t work in , and for other browsers, we used the non-standard property -webkit-mask-box-image-slice.

Mask used for animation.
The first animation is done on the digital parameters. The second one involves the last parameter (fill).
We notice that involving this parameter in an animation makes it discrete.


Simulator.
The mask is applied here to an element containing text. Here is the mask, the natural value for slice is 20. The central part of the mask is semi-transparent. The border of the element is 20 pixels thick.

Browsers compatibility with mask-border-slice.
For now, browsers don't handle the border masking technique well enough (2026). in particular is lagging behind.
On other browsers, you can use the -webkit-mask-box-image-slice property instead of mask-border-slice.
mask-border-slice which defines how the border mark should be cut.Notes:
(1) Use the non-standard property -webkit-mask-box-image-slice.
mask-border-sliceproperty
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-slice 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-sliceIntroduction of the propertymask-border-slice, along with all those concerning border marks.November 15, 2012Working Draft.August 26, 2014Candidate Recommendation.
See also, about masking techniques.
The specification that standardizes everything about masking is called CSS Masking Module.
It describes the mask-border-slice property and the properties below:
Properties:













