aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/css/border-bottom-width/index.html
blob: 01fb760c65ca0895156bd2cd68c23e22d40fb067 (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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
---
title: border-bottom-width
slug: Web/CSS/border-bottom-width
translation_of: Web/CSS/border-bottom-width
---
<div>{{CSSRef}}</div>

<div><a href="/en/CSS" title="CSS">CSS</a> 属性 <strong><code>border-bottom-width</code></strong> 设置一个元素的底部边框宽度。</div>

<pre class="brush:css no-line-numbers">/* Keyword values */
border-bottom-width: thin;
border-bottom-width: medium;
border-bottom-width: thick;

/* &lt;length&gt; values */
border-bottom-width: 10em;
border-bottom-width: 3vmax;
border-bottom-width: 6px;

/* Global keywords */
border-bottom-width: inherit;
border-bottom-width: initial;
border-bottom-width: unset;
</pre>

<p>{{cssinfo}}</p>

<h2 id="Syntax" name="Syntax">Syntax</h2>

<h3 id="Values">Values</h3>

<dl>
 <dt>&lt;<code>br-width&gt;</code></dt>
 <dd>定义边框宽度,取值为非负的宽度值{{cssxref("&lt;length&gt;")}}或关键字。 如果是关键字的话,其取值必须是以下之一:
 <table class="standard-table">
  <tbody>
   <tr>
    <td style="vertical-align: middle;"><code>thin</code></td>
    <td style="vertical-align: middle;">
     <div style="margin: 0.5em; width: 3em; height: 3em; border-bottom-style: solid; border-bottom-width: thin; background-color: palegreen;"> </div>
    </td>
    <td style="vertical-align: middle;">细边框</td>
   </tr>
   <tr>
    <td style="vertical-align: middle;"><code>medium</code></td>
    <td style="vertical-align: middle;">
     <div style="margin: 0.5em; width: 3em; height: 3em; border-bottom-style: solid; border-bottom-width: medium; background-color: palegreen;"> </div>
    </td>
    <td style="vertical-align: middle;">中等边框</td>
   </tr>
   <tr>
    <td style="vertical-align: middle;"><code>thick</code></td>
    <td style="vertical-align: middle;">
     <div style="margin: 0.5em; width: 3em; height: 3em; border-bottom-style: solid; border-bottom-width: thick; background-color: palegreen;"> </div>
    </td>
    <td style="vertical-align: middle;">粗边框</td>
   </tr>
  </tbody>
 </table>

 <div class="note">
 <p><strong>Note:</strong> 因为规范没有具体定义每个关键字对应的宽度值,所以实际显示效果依赖于实现。但是宽度值的取值一定遵循 <code>thin ≤ medium ≤ thick</code> 的规律且在单文档中是常数。</p>
 </div>
 </dd>
</dl>

<h3 id="Formal_syntax">Formal syntax</h3>

{{csssyntax}}

<h2 id="Example">Example</h2>

<h3 id="HTML">HTML</h3>

<pre class="brush: html">&lt;div&gt;Element 1&lt;/div&gt;
&lt;div&gt;Element 2&lt;/div&gt;</pre>

<h3 id="CSS">CSS</h3>

<pre class="brush: css">div {
  border: 1px solid red;
  margin: 1em 0;
}

div:nth-child(1) {
  border-bottom-width: thick;
}
div:nth-child(2) {
  border-bottom-width: 2em;
}</pre>

<h3 id="Result">Result</h3>

<p>{{EmbedLiveSample('Example', '100%')}}</p>

<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('CSS3 Backgrounds', '#the-border-width', 'border-bottom-width') }}</td>
   <td>{{ Spec2('CSS3 Backgrounds') }}</td>
   <td>No significant change.</td>
  </tr>
  <tr>
   <td>{{SpecName('CSS2.1', 'box.html#border-width-properties', 'border-bottom-width')}}</td>
   <td>{{Spec2('CSS2.1')}}</td>
   <td>No significant change.</td>
  </tr>
  <tr>
   <td>{{SpecName('CSS1', '#border-left-width', 'border-bottom-width')}}</td>
   <td>{{Spec2('CSS1')}}</td>
   <td>Initial definition.</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_Compatibility" name="Browser_Compatibility">Browser compatibility</h2>



<p>{{Compat("css.properties.border-bottom-width")}}</p>

<h2 id="See_Also" name="See_Also">See also</h2>

<ul>
 <li>The other border-width-related CSS properties: {{ Cssxref("border-left-width") }}, {{ Cssxref("border-right-width") }}, {{ Cssxref("border-top-width") }}, and {{ Cssxref("border-width") }}.</li>
 <li>The other border-bottom-related CSS properties: {{ Cssxref("border") }}, {{ Cssxref("border-bottom") }}, {{ Cssxref("border-bottom-style") }}, and {{ Cssxref("border-bottom-color") }}.</li>
</ul>