--- title: border-bottom-width slug: Web/CSS/border-bottom-width translation_of: Web/CSS/border-bottom-width ---
{{CSSRef}}
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;

{{cssinfo}}

Syntax

Values

<br-width>
定义边框宽度,取值为非负的宽度值{{cssxref("<length>")}}或关键字。 如果是关键字的话,其取值必须是以下之一:
thin
 
细边框
medium
 
中等边框
thick
 
粗边框

Note: 因为规范没有具体定义每个关键字对应的宽度值,所以实际显示效果依赖于实现。但是宽度值的取值一定遵循 thin ≤ medium ≤ thick 的规律且在单文档中是常数。

Formal syntax

{{csssyntax}}

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

{{EmbedLiveSample('Example', '100%')}}

Specifications

Specification Status Comment
{{ SpecName('CSS3 Backgrounds', '#the-border-width', 'border-bottom-width') }} {{ Spec2('CSS3 Backgrounds') }} No significant change.
{{SpecName('CSS2.1', 'box.html#border-width-properties', 'border-bottom-width')}} {{Spec2('CSS2.1')}} No significant change.
{{SpecName('CSS1', '#border-left-width', 'border-bottom-width')}} {{Spec2('CSS1')}} Initial definition.

Browser compatibility

{{Compat("css.properties.border-bottom-width")}}

See also