blob: c161c7ac0e14068644a2d14c2a05fb26da55c461 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
---
title: mask-border-width
slug: Web/CSS/mask-border-width
translation_of: Web/CSS/mask-border-width
---
<div>{{CSSRef}}{{SeeCompatTable}}</div>
<div><code><strong>mask-border-width</strong></code> <a href="/zh-CN/docs/Web/CSS">CSS</a> 属性设置元素的 <a href="/zh-CN/docs/Web/CSS/mask-border">mask border</a>的宽度</div>
<h2 id="语法">语法</h2>
<pre class="brush:css no-line-numbers">/* Keyword value */
mask-border-width: auto;
/* <length> value */
mask-border-width: 1rem;
/* <percentage> value */
mask-border-width: 25%;
/* <number> value */
mask-border-width: 3;
/* vertical | horizontal */
mask-border-width: 2em 3em;
/* top | horizontal | bottom */
mask-border-width: 5% 15% 10%;
/* top | right | bottom | left */
mask-border-width: 5% 2em 10% auto;
/* Global values */
mask-border-width: inherit;
mask-border-width: initial;
mask-border-width: unset;
</pre>
<p>可以使用从下面的值列表中选择的一个,两个,三个或四个值来指定<code>mask-border-width</code>属性。</p>
<ul>
<li>指定一个值时,即对应四条边的宽度;</li>
<li>指定两个值时,第一个值对应上下边框的宽度,第二个值对应左右边框的宽度;</li>
<li>指定三个值时,第一个值对应上边框的宽度,第二个值对应左右边框的宽度,第三个值对应底部边框的宽度;</li>
<li>指定四个值时,按顺时针方向,分别对应上,右,下,左边框的宽度。</li>
</ul>
<h3 id="值">值</h3>
<dl>
<dt><code><length-percentage></code></dt>
<dd><code>mask</code>边框宽度指定一个值或者百分比,设定百分比时,是相对于<code>mask</code>的长度和宽度。不能为负数。</dd>
<dt><font face="consolas, Liberation Mono, courier, monospace"><span style="background-color: rgba(220, 220, 220, 0.5);"><number></span></font></dt>
<dd>mask边框宽度为元素<code>border-width</code>的倍数。不能为负数。</dd>
<dt><code>auto</code></dt>
<dd>使<code>mask-border</code>的宽度等于相应<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/mask-border-slice" title="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."><code>mask-border-slice</code></a>的固有宽度或高度(以适用者为准),如果图像没有所需的固有尺寸,则使用相应的边框宽度。</dd>
</dl>
<h3 id="Formal_syntax">Formal syntax</h3>
<pre class="syntaxbox">{{csssyntax}}</pre>
<h2 id="Specifications" name="Specifications">Specifications</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName("CSS Masks", "#propdef-mask-border-width", "mask-border-width")}}</td>
<td>{{Spec2("CSS Masks")}}</td>
<td>Initial definition</td>
</tr>
</tbody>
</table>
<p>{{cssinfo}}</p>
<h2 id="浏览器兼容性">浏览器兼容性</h2>
<p>待定</p>
|