{{CSSRef}}{{SeeCompatTable}}
Summary
The mask-origin
CSS property determines the origin of a mask.
For elements rendered as a single box, this property specifies the mask positioning area. In other words, this property specifies the origin position of an image specified by the {{cssxref("mask-image")}} CSS property. For elements rendered as multiple boxes, such as inline boxes on several lines or boxes on several pages, it specifies which boxes {{cssxref("box-decoration-break")}} operates upon to determine the mask positioning area.
{{cssinfo}}
Syntax
/* Keyword values */ mask-origin: content-box; mask-origin: padding-box; mask-origin: border-box; mask-origin: margin-box; mask-origin: fill-box; mask-origin: stroke-box; mask-origin: view-box; /* Multiple values */ mask-origin: padding-box, content-box; mask-origin: view-box, fill-box, border-box; /* Global values */ mask-origin: inherit; mask-origin: initial; mask-origin: unset;
Values
content-box
- The position is relative to the content box.
padding-box
- The position is relative to the padding box. For single boxes
0 0
is the upper left corner of the padding edge,100% 100%
is the lower right corner. border-box
- The position is relative to the border box.
margin-box
- The position is relative to the margin box.
fill-box
- The position is relative to the object bounding box.
stroke-box
- The position is relative 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 theviewBox
attribute and the dimension of the reference box is set to the width and height values of theviewBox
attribute.
Formal syntax
{{csssyntax}}
Example
{{TODO}}
Specifications
Specification | Status | Comment |
---|---|---|
{{SpecName("CSS Masks", "#the-mask-origin", "mask-origin")}} | {{Spec2("CSS Masks")}} | Initial definition |
Browser compatibility
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | {{CompatUnknown}} | {{CompatNo}}[1] | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | {{CompatUnknown}} | {{CompatNo}}[1] | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
[1] Gecko currently doesn't implement this feature. See {{bug("1251161")}}.