CSS mask-border-slice Property
Example
.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%;
}
Meaning:
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:
- When one position is specified, it creates all four slices at the same distance from their respective sides.
- When two positions are specified, the first value creates slices measured from the top and bottom, the second creates slices measured from the left and right.
- When three positions are specified, the first value creates a slice measured from the top, the second creates slices measured from the left and right, the third creates a slice measured from the bottom.
- When four positions are specified, they create slices measured from the top, right, bottom, and left in that order (clockwise).
The optional fill value, if used, can be placed anywhere in the declaration.
Default value: | 0 |
Inherited: | No |
Animatable: | No |
Version: | CSS3 |
JavaScript syntax: |
|
Standard Syntax
mask-border-slice: number|percentage|fill|initial|inherit|revert|revert-layer|unset;
Browser Support
Status
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;
}