aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/css/border-bottom-left-radius/index.html
blob: c1982c205c7e5943d74ab328b14f7cb47b02b14b (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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
---
title: 左下边框圆角
slug: Web/CSS/border-bottom-left-radius
translation_of: Web/CSS/border-bottom-left-radius
---
<div>{{CSSRef}}</div>

<h2 id="Summary">Summary</h2>

<p>总览</p>

<p><strong><code>border-bottom-left-radius</code></strong> 这个css属性设置元素左下角的圆角。圆角可以是圆或椭圆(注:应为圆或椭圆的一部分),或者当其中一个值为0时,圆角将不被设置,这时这个角将展示为直角。</p>

<div style="text-align: center;"><img alt="border-bottom-left-radius.png" class="default internal" src="/@api/deki/files/6136/=border-bottom-left-radius.png"></div>

<p>一个无论是图像或颜色的背景,都会在边框上被裁剪,即使背景是圆角的; 裁剪的确切位置由 {{cssxref("background-clip")}} 属性定义.</p>

<div class="note">如果该属性的值没有被一个在<strong><code>border-bottom-left-radius</code></strong> 属性后,作用于当前元素上的{{cssxref("border-radius")}}简写属性设置,那么该属性值将会被<a href="/zh-CN/docs/Web/CSS/Shorthand_properties">shorthand property</a>重置为初始值。</div>

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

<h2 id="语法">语法</h2>

<pre class="brush:css notranslate">/* 圆形 */
/* border-bottom-left-radius: <em>radius</em> */
border-bottom-left-radius: 3px;

/* 椭圆形 */
/* border-bottom-left-radius: <em>水平</em>方向 <em>垂直方向</em> */
border-bottom-left-radius: 0.5em 1em;

border-bottom-left-radius: inherit;
</pre>

<div style="font-size: 0.9em;">
<p>where:</p>

<dl style="padding-left: 6em;">
 <dt style="float: left; width: 7.5em;"><em>radius</em></dt>
 <dd style="padding-left: 7.5em;">Is a {{cssxref("&lt;length&gt;")}} or a {{cssxref("&lt;percentage&gt;")}} denoting the radius of the circle to use for the border in that corner.</dd>
 <dt style="float: left; width: 7.5em;"><em>horizontal</em></dt>
 <dd style="padding-left: 7.5em;">Is a {{cssxref("&lt;length&gt;")}} or a {{cssxref("&lt;percentage&gt;")}} denoting the horizontal semi-major axis of the ellipsis to use for the border in that corner.</dd>
 <dt style="float: left; width: 7.5em;"><em>vertical</em></dt>
 <dd style="padding-left: 7.5em;">Is a {{cssxref("&lt;length&gt;")}} or a {{cssxref("&lt;percentage&gt;")}} denoting the vertical semi-major axis of the ellipsis to use for the border in that corner.</dd>
</dl>
</div>

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

<dl>
 <dt><code>&lt;length-percentage&gt;</code></dt>
 <dd>Denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipsis. As absolute length it can be expressed in any unit allowed by the CSS {{cssxref("&lt;length&gt;")}} data type. Percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. Negative values are invalid.</dd>
</dl>

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

{{csssyntax}}

<h2 id="Examples">Examples</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th>Live example</th>
   <th>Code</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td style="padding: 1.5em;">
    <div style="background-color: lightgreen; border: solid 1px black; border-bottom-left-radius: 40px 40px; width: 100px; height: 100px;">
    <div class="hidden">.</div>
    </div>
   </td>
   <td>An arc of circle is used as the border
    <pre class="brush: css notranslate">
div {
  border-bottom-left-radius: 40px 40px;
}
</pre>
   </td>
  </tr>
  <tr>
   <td style="padding: 1.5em;">
    <div style="background-color: lightgreen; border: solid 1px black; border-bottom-left-radius: 40px 20px; width: 100px; height: 100px;">
    <div class="hidden">.</div>
    </div>
   </td>
   <td>An arc of ellipse is used as the border
    <pre class="brush: css notranslate">
div {
  border-bottom-left-radius: 40px 20px;
}
</pre>
   </td>
  </tr>
  <tr>
   <td style="padding: 1.5em;">
    <div style="background-color: lightgreen; border: solid 1px black; border-bottom-left-radius: 40%; width: 100px; height: 100px;">
    <div class="hidden">.</div>
    </div>
   </td>
   <td>The box is a square: an arc of circle is used as the border
    <pre class="brush: css notranslate">
div {
  border-bottom-left-radius: 40%;
}
</pre>
   </td>
  </tr>
  <tr>
   <td style="padding: 1.5em;">
    <div style="background-color: lightgreen; border: solid 1px black; border-bottom-left-radius: 40%; width: 100px; height: 200px;">
    <div class="hidden">.</div>
    </div>
   </td>
   <td>The box is not a square: an arc of ellipse is used as the border
    <pre class="brush: css notranslate">
div {
  border-bottom-left-radius: 40%;
}
</pre>
   </td>
  </tr>
  <tr>
   <td style="padding: 1.5em;">
    <div style="border: black 3px double; border-bottom-left-radius: 40%; height: 100px; width: 100px; background-color: rgb(250,20,70); background-clip: content-box;">
    <div class="hidden">.</div>
    </div>
   </td>
   <td>The background color is clipped at the border
    <pre class="brush: css notranslate">
div {
  border-bottom-left-radius:40%;
  border-style: black 3px double;
  background-color: rgb(250,20,70);
  background-clip: content-box;
}
</pre>
   </td>
  </tr>
 </tbody>
</table>

<h2 id="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', '#border-bottom-left-radius', 'border-bottom-left-radius')}}</td>
   <td>{{Spec2('CSS3 Backgrounds')}}</td>
   <td>Initial definition</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<p>{{CompatibilityTable}}</p>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Edge</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari (WebKit)</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>1.0 {{property_prefix("-webkit")}}<br>
    4.0</td>
   <td>{{CompatVersionUnknown}}{{property_prefix("-webkit")}}<br>
    {{CompatVersionUnknown}}</td>
   <td>1.0 (1.0){{property_prefix("-moz")}}<sup>[1]</sup><br>
    4.0 (2.0)<sup>[3]</sup></td>
   <td>9.0</td>
   <td>10.5</td>
   <td>3.0 (522){{property_prefix("-webkit")}}<br>
    5.0 (532.5)</td>
  </tr>
  <tr>
   <td>Percentages</td>
   <td>4.0</td>
   <td>{{CompatUnknown}}</td>
   <td>1.0 (1.0)<sup>[2]</sup><br>
    4.0 (2.0)</td>
   <td>9.0</td>
   <td>10.5</td>
   <td>5.0 (532.5)</td>
  </tr>
  <tr>
   <td>Elliptical corners</td>
   <td>1.0</td>
   <td>{{CompatUnknown}}</td>
   <td>3.5 (1.9.1)</td>
   <td>9.0</td>
   <td>10.5</td>
   <td>3.0 (522)</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Edge</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Phone</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatVersionUnknown}}{{property_prefix("-webkit")}}<br>
    {{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}<sup>[3]</sup></td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td>Percentages</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td>Elliptical corners</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
 </tbody>
</table>
</div>

<p>[1] The prefixed version (allowed from Firefox 1 to Firefox 12) of this property uses a different name, <code>-moz-border-radius-bottomleft</code>, than the final property as Mozilla implemented it before the final name was coined.</p>

<p>[2] Before Firefox 4, the {{cssxref("&lt;percentage&gt;")}} was relative to the width of the box even when specifying the radius for a height). This implied that <code>-moz-border-radius-bottomleft</code> was always drawing an arc of circle, and never an ellipse, when followed by a single value.</p>

<p>[3] Prior to Gecko 50.0 {{geckoRelease("50.0")}}, border styles of rounded corners were always rendered as if <code>border-style</code> was <code>solid</code>. This has been fixed in Gecko 50.0.</p>

<p>In addition to the unprefixed support, Gecko 44.0 {{geckoRelease("44.0")}} added support for a <code>-webkit</code> prefixed version of the property for web compatibility reasons behind the preference <code>layout.css.prefixes.webkit</code>, defaulting to <code>false</code>. Since Gecko 49.0 {{geckoRelease("49.0")}} the preference defaults to <code>true</code>.</p>

<h2 id="See_also">See also</h2>

<p>The border-radius-related CSS properties: the CSS shorthand {{cssxref("border-radius")}}, the properties for the other corners: {{cssxref("border-top-right-radius")}}, {{cssxref("border-bottom-right-radius")}}, and {{cssxref("border-top-left-radius")}}.</p>