border-bottom-width
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
CSS 属性 border-bottom-width
设置一个元素的底部边框宽度。
css
/* 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 |
---|---|
适用元素 | 所有元素. It also applies to ::first-letter . |
是否是继承属性 | 否 |
计算值 | 绝对长度;或如果 border-bottom-style 的值是 none 或 hidden ,则为 0 |
动画类型 | a length |
Syntax
Values
- <
br-width>
-
定义边框宽度,取值为非负的宽度值
<length>
或关键字。如果是关键字的话,其取值必须是以下之一:thin
细边框 medium
中等边框 thick
粗边框 备注: 因为规范没有具体定义每个关键字对应的宽度值,所以实际显示效果依赖于实现。但是宽度值的取值一定遵循
thin ≤ medium ≤ thick
的规律且在单文档中是常数。
Formal syntax
border-bottom-width =
<line-width>
<line-width> =
<length [0,∞]> |
thin |
medium |
thick
Example
HTML
html
<div>Element 1</div>
<div>Element 2</div>
CSS
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 |
---|
CSS Backgrounds and Borders Module Level 3 # the-border-width |
Browser compatibility
BCD tables only load in the browser
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
.