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.
/* <geometry-box> values */ mask-clip: content-box; mask-clip: padding-box; mask-clip: border-box; mask-clip: margin-box; mask-clip: fill-box; mask-clip: stroke-box; mask-clip: view-box; /* Keyword values */ mask-clip: no-clip; /* Non-standard keyword values */ -webkit-mask-clip: border; -webkit-mask-clip: padding; -webkit-mask-clip: content; -webkit-mask-clip: text; /* Multiple values */ mask-clip: padding-box, no-clip; mask-clip: view-box, fill-box, border-box; /* Global values */ mask-clip: inherit; mask-clip: initial; mask-clip: unset;
One or more of the keyword values listed below, separated by commas.
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
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
属性。
no-clip
The painted content is not clipped.
border
border-box
.
padding
padding-box
.
content
content-box
.
text
This keyword clips the mask image to the text of the element.
| 初始值 |
border-box
|
|---|---|
| 适用于 |
all elements; In SVG, it applies to container elements excluding the
defs
element and all graphics elements
|
| 继承 | no |
| 计算值 | 如指定 |
| 动画类型 | discrete |
[ <geometry-box> | no-clip ]#where
<geometry-box> = <shape-box> | fill-box | stroke-box | view-box
Change the
mask-clip
value to any of the allowed values detailed above. If viewing the example in a Chromium-based browser change the value of
-webkit-mask-clip
.
| 规范 | 状态 | 注释 |
|---|---|---|
|
CSS Masking Module Level 1
The definition of 'mask-clip' in that specification. |
候选推荐 | 初始定义 |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
mask-clip
|
Chrome
完整支持
1
Prefixed
|
Edge
完整支持
79
Prefixed
|
Firefox
完整支持
53
|
IE 不支持 No |
Opera
完整支持
15
Prefixed
|
Safari
完整支持
4
Prefixed
|
WebView Android
完整支持
2
Prefixed
|
Chrome Android
完整支持
18
Prefixed
|
Firefox Android
完整支持
53
|
Opera Android
完整支持
14
Prefixed
|
Safari iOS
完整支持
3.2
Prefixed
|
Samsung Internet Android
完整支持
1.0
Prefixed
|
border
|
Chrome 完整支持 1 | Edge 完整支持 79 | Firefox 不支持 No | IE 不支持 No | Opera 完整支持 15 | Safari 完整支持 4 | WebView Android 完整支持 2 | Chrome Android 完整支持 18 | Firefox Android 不支持 No | Opera Android 完整支持 14 | Safari iOS 完整支持 3.2 | Samsung Internet Android 完整支持 1.0 |
content</content>
非标
|
Chrome 完整支持 1 | Edge 完整支持 79 | Firefox 不支持 No | IE 不支持 No | Opera 完整支持 15 | Safari 完整支持 4 | WebView Android 完整支持 2 | Chrome Android 完整支持 18 | Firefox Android 不支持 No | Opera Android 完整支持 14 | Safari iOS 完整支持 3.2 | Samsung Internet Android 完整支持 1.0 |
padding
非标
|
Chrome 完整支持 1 | Edge 完整支持 79 | Firefox 不支持 No | IE 不支持 No | Opera 完整支持 15 | Safari 完整支持 4 | WebView Android 完整支持 2 | Chrome Android 完整支持 18 | Firefox Android 不支持 No | Opera Android 完整支持 14 | Safari iOS 完整支持 3.2 | Samsung Internet Android 完整支持 1.0 |
text
非标
|
Chrome 完整支持 1 | Edge 完整支持 79 | Firefox 不支持 No | IE 不支持 No | Opera 完整支持 15 | Safari 完整支持 4 | WebView Android 完整支持 2 | Chrome Android 完整支持 18 | Firefox Android 不支持 No | Opera Android 完整支持 14 | Safari iOS 完整支持 3.2 | Samsung Internet Android 完整支持 1.0 |
完整支持
不支持
非标。预期跨浏览器支持较差。
用户必须明确启用此特征。
要求使用供应商前缀或不同名称。