border-bottom-width

border-bottom-widthCSS のプロパティで、ボックスの下の境界の幅を設定します。

試してみましょう

構文

css
/* キーワード値 */
border-bottom-width: thin;
border-bottom-width: medium;
border-bottom-width: thick;

/* <length> 値 */
border-bottom-width: 10em;
border-bottom-width: 3vmax;
border-bottom-width: 6px;

/* グローバルキーワード */
border-bottom-width: inherit;
border-bottom-width: initial;
border-bottom-width: revert;
border-bottom-width: revert-layer;
border-bottom-width: unset;

<line-width>

境界の幅を、明示的な非負の <length> またはキーワードで定義します。キーワードの場合、以下の値のいずれかでなければなりません。

  • thin
  • medium
  • thick

メモ: 仕様書ではそれぞれのキーワードで示される正確な太さを定義していないため、いずれかを使用した場合の詳細な結果は、実装に依存します。とは言っても、常に thin ≤ medium ≤ thick というパターンに従い、値は同じ文書の中では一貫しています。

公式定義

初期値medium
適用対象すべての要素。 ::first-letter にも適用されます。
継承なし
計算値絶対的な長さ、または border-bottom-stylenone または hidden の場合は 0
アニメーションの種類length

形式文法

border-bottom-width = 
<line-width>

<line-width> =
<length [0,∞]> |
thin |
medium |
thick

下境界の太さの比較

HTML

html
<div>Element 1</div>
<div>Element 2</div>

CSS

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;
}

結果

仕様書

Specification
CSS Backgrounds and Borders Module Level 3
# the-border-width

ブラウザーの互換性

BCD tables only load in the browser

関連情報