--- title: border-bottom-width slug: Web/CSS/border-bottom-width translation_of: Web/CSS/border-bottom-width ---
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}}
br-width>
thin |
|
细边框 |
medium |
|
中等边框 |
thick |
|
粗边框 |
Note: 因为规范没有具体定义每个关键字对应的宽度值,所以实际显示效果依赖于实现。但是宽度值的取值一定遵循 thin ≤ medium ≤ thick
的规律且在单文档中是常数。
{{csssyntax}}
<div>Element 1</div> <div>Element 2</div>
div { border: 1px solid red; margin: 1em 0; } div:nth-child(1) { border-bottom-width: thick; } div:nth-child(2) { border-bottom-width: 2em; }
{{EmbedLiveSample('Example', '100%')}}
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. |
{{Compat("css.properties.border-bottom-width")}}