CSS 属性
border-bottom-width
设置一个元素的底部边框宽度。/* Keyword values */ border-bottom-width: thin; border-bottom-width: medium; border-bottom-width: thick; /* <length> 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;
初始值 | medium |
---|---|
适用元素 | all elements. It also applies to ::first-letter . |
是否是继承属性 | 否 |
适用媒体 | visual |
计算值 | the absolute length or 0 if border-bottom-style is none or hidden |
Animation type | a length |
正规顺序 | the unique non-ambiguous order defined by the formal grammar |
Syntax
Values
- <
br-width>
- 定义边框宽度,取值为非负的宽度值
<length>
或关键字。 如果是关键字的话,其取值必须是以下之一:thin
细边框 medium
中等边框 thick
粗边框 Note: 因为规范没有具体定义每个关键字对应的宽度值,所以实际显示效果依赖于实现。但是宽度值的取值一定遵循
thin ≤ medium ≤ thick
的规律且在单文档中是常数。
Formal syntax
<br-width>
Example
HTML
<div>Element 1</div> <div>Element 2</div>
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; }
Result
Specifications
Specification | Status | Comment |
---|---|---|
CSS Backgrounds and Borders Module Level 3 border-bottom-width |
Candidate Recommendation | No significant change. |
CSS Level 2 (Revision 1) border-bottom-width |
Recommendation | No significant change. |
CSS Level 1 border-bottom-width |
Recommendation | Initial definition. |
Browser compatibility
The compatibility table in 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.
Feature | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | 1 | 12 | 1 | 4 | 3.5 | 1 |
Feature | Android webview | Chrome for Android | Edge mobile | Firefox for Android | Opera Android | iOS Safari | Samsung Internet |
---|---|---|---|---|---|---|---|
Basic support | 2.3 | ? | Yes | 4 | 11 | 1 | ? |
See also
- The other border-width-related CSS properties:
border-left-width
,border-right-width
,border-top-width
, andborder-width
. - The other border-bottom-related CSS properties:
border
,border-bottom
,border-bottom-style
, andborder-bottom-color
.