非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。

-webkit-mask-box-image sets the mask image for an element's border box.

句法

-webkit-mask-box-image: <mask-box-image> [<top> <right> <bottom> <left> <x-repeat> <y-repeat>]
					

Where:

<mask-box-image>
<uri> | <gradient> | none
<top> <right> <bottom> <left>
<length> | <percentage>
<x-repeat> <y-repeat>
repeat | stretch | round | space

<uri>

The location of the image resource to be used as a mask image.

<gradient>
A -webkit-gradient function to be used as a mask image.
none

Used to specify that a border box is to have no mask image.

<length>
The size of the mask image's offset. See <length> for possible units.
<percentage>

The mask image's offset has a percentage value relative to the border box's corresponding dimension (width or height).

repeat

The mask image is repeated as many times as is necessary to span the border box. May include a partial image if the mask image does not divide evenly into the border box.

stretch

The mask image is stretched to contain the border box exactly.

round

The mask image is stretched somewhat and repeated such that there is no partial mask image at the end of the border box.

space

The mask image is repeated as many times as possible without stretching. There is no partial mask image at the end of the border box.

形式定义

Value not found in DB!

形式句法

Syntax not found in DB!
					

范例

Setting an image

.exampleone {
  -webkit-mask-box-image: url('mask.png');
}
					

Offsetting and filling an image

.exampletwo {
  -webkit-mask-box-image: url('logo.png') 100 100 0 0 round round;
}
					

规范

Not part of any standard.

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
-webkit-mask-box-image 非标 Chrome 完整支持 1 Edge 完整支持 18 Firefox 不支持 No IE 不支持 No Opera 完整支持 15 Safari 完整支持 3.2 WebView Android 完整支持 2 Chrome Android 完整支持 18 Firefox Android 不支持 No Opera Android 完整支持 14 Safari iOS 完整支持 3.2 Samsung Internet Android 完整支持 1.0

图例

完整支持

完整支持

不支持

不支持

非标。预期跨浏览器支持较差。

非标。预期跨浏览器支持较差。

另请参阅

-webkit-mask , -webkit-mask-origin , -webkit-mask-attachment , -webkit-mask-clip , -webkit-mask-image , -webkit-mask-composite , -webkit-mask-repeat

元数据

  • 最后修改:
  1. CSS
  2. CSS 参考