CSS mask-border-slice Property

❮ Previous Reference Next ❯


.example {
  /* Standard syntax*/
  mask-border: url("hello-world.png");
  mask-border-slice: 10% 50%;

  /* Chromium based browser */
  -webkit-mask-box-image: url("hello-world.png");
  -webkit-mask-box-image-slice: 10% 50%;


The mask-border-slice CSS property divides the image set by mask-border-source into regions. These regions are used to form the components of an element's mask-border.

Note: Chromium-based browsers support an outdated version of this property — -webkit-mask-box-image-slice — with a prefix.

Possible values:

The optional fill value, if used, can be placed anywhere in the declaration.

Default value:0
JavaScript syntax:

Standard Syntax

mask-border-slice: number|percentage|fill|initial|inherit|revert|revert-layer|unset;

Browser Support


Property Values

The following table describes the values of this property:

Value Description
number Represents an edge offset in pixels for raster images and coordinates for vector images. For vector images, the number is relative to the element's size, not the size of the source image, so percentages are generally preferable in these cases.
percentage Represents an edge offset as a percentage of the source image's size: the width of the image for horizontal offsets, the height for vertical offsets.
fill Preserves the middle image region. Its width and height are sized to match the top and left image regions, respectively.
initial Sets this property to its default value.
inherit If specified, the associated element takes the computed value of its parent element animation-delay property.
revert Reverts the cascaded value of the property from its current value to the value the property
revert-layer Rollback styles to the ones specified in previous cascade layers.
unset Resets a property to its inherited value if the property naturally inherits from its parent, and to its initial value if not.

Default CSS Property Values

selectors {
  mask-border-slice: 0;
❮ Previous Reference Next ❯