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 typea 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

<line-width>

where
<line-width> = <length> | thin | medium | thick

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

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support 4Opera Full support 3.5Safari Full support 1WebView Android Full support 2.3Chrome Android ? Edge Mobile Full support YesFirefox Android Full support 4Opera Android Full support 11Safari iOS Full support 1Samsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown

See also

文档标签和贡献者

此页面的贡献者: Tamce
最后编辑者: Tamce,