大网数据广告活动
Web 标准与前端开发

border-bottom-width

· 52CE 我爱测

CSS 属性 **`border-bottom-width`** 设置一个元素的底部边框宽度。

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。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。