border-bottom-width - CSS(层叠样式表) 编辑
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 . |
是否是继承属性 | 否 |
计算值 | the absolute length or 0 if border-bottom-style is none or hidden |
Animation type | a length |
Syntax
Values
- <
br-width>
- 定义边框宽度,取值为非负的宽度值
<length>
或关键字。 如果是关键字的话,其取值必须是以下之一:thin
细边框 medium
中等边框 thick
粗边框 Note: 因为规范没有具体定义每个关键字对应的宽度值,所以实际显示效果依赖于实现。但是宽度值的取值一定遵循
thin ≤ medium ≤ thick
的规律且在单文档中是常数。
Formal syntax
<line-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
BCD tables only load in the browser
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.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
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论