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;
Syntax
Values
- <
br-width>-
: 定义边框宽度,取值为非负的宽度值<length>或关键字。如果是关键字的话,其取值必须是以下之一:
thin细边框 medium中等边框 thick粗边框 [!NOTE] 因为规范没有具体定义每个关键字对应的宽度值,所以实际显示效果依赖于实现。但是宽度值的取值一定遵循
thin ≤ medium ≤ thick的规律且在单文档中是常数。
-
Formal syntax
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
Example
Specifications
Browser compatibility
See also
- The other border-width-related CSS properties: border-left-width, border-right-width, border-top-width, and border-width.
- The other border-bottom-related CSS properties: border, border-bottom, border-bottom-style, and border-bottom-color.
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
