CSS mask-clip Property

❮ Previous Reference Next ❯

Example

.example {
  background-color: #1A73E8;
  padding: 30px;
  mask-image: url(hello-world.png);
  mask-size: 100% 100%;
  mask-clip: border-box;
  -webkit-mask-image: url(hello-world.png);
  -webkit-mask-size: 100% 100%;
  -webkit-mask-clip: border-box;
}

Meaning:

The mask-clip CSS property determines the area which is affected by a mask.

The painted content of an element must be restricted to this area.

Default value:border-box
Inherited:No
Animatable:No
Version:CSS3
JavaScript syntax:
object.style.maskClip="value";



Standard Syntax

mask-clip: value;



Browser Support




Status







Property Values

The following table describes the values of this property:

Value Description
content-box The painted content is clipped to the content box.
padding-box The painted content is clipped to the padding box.
border-box The painted content is clipped to the border box.
margin-box The painted content is clipped to the margin box.
fill-box The painted content is clipped to the object bounding box.
stroke-box The painted content is clipped to the stroke bounding box.
view-box Uses the nearest SVG viewport as reference box. If a viewBox attribute is specified for the element creating the SVG viewport, the reference box is positioned at the origin of the coordinate system established by the viewBox attribute and the dimension of the reference box is set to the width and height values of the viewBox attribute.
no-clip The painted content is not clipped.
border Non-standard. This keyword behaves the same as border-box.
padding Non-standard. This keyword behaves the same as padding-box.
content Non-standard. This keyword behaves the same as content-box.
text Non-standard. This keyword clips the mask image to the text of the element.
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-clip: border-box;
}
❮ Previous Reference Next ❯