border-bottom
試してみましょう
他の一括指定プロパティと同様に、 border-bottom は、一部の値が指定されていなくても、設定可能なプロパティをすべて設定します。指定されていないプロパティは既定値が設定されます。つまり・・・
css
border-bottom-style: dotted;
border-bottom: thick green;
・・・は、実際には以下と同じです・・・
css
border-bottom-style: dotted;
border-bottom: none thick green;
・・・そして、 border-bottom の前で設定された border-bottom-style の値は無視されます。 border-bottom-style の既定値は none なので、 border-style の部分の設定は境界線なしとなります。
構成要素のプロパティ
このプロパティは以下の CSS プロパティの一括指定です。
構文
css
border-bottom: 1px;
border-bottom: 2px dotted;
border-bottom: medium dashed blue;
/* グローバル値 */
border-bottom: inherit;
border-bottom: initial;
border-bottom: revert;
border-bottom: unset;
一括指定プロパティの 3 つの値は任意の順序で指定可能で、また、 1 つまたは 2 つの値を省略することができます。
値
<br-width>-
border-bottom-widthを参照してください。 <br-style>-
border-bottom-styleを参照してください。 <color>-
border-bottom-colorを参照してください。
公式定義
| 初期値 | 一括指定の次の各プロパティとして
|
|---|---|
| 適用対象 | すべての要素。 ::first-letter にも適用されます。 |
| 継承 | なし |
| 計算値 | 一括指定の次の各プロパティとして
|
| アニメーションの種類 | 一括指定の次の各プロパティとして |
形式文法
例
下の境界の適用
HTML
html
<div>
このボックスには下側に境界線があります。
</div>
CSS
css
div {
border-bottom: 4px dashed blue;
background-color: gold;
height: 100px;
width: 100px;
font-weight: bold;
text-align: center;
}
結果
仕様書
| Specification |
|---|
| CSS Backgrounds and Borders Module Level 3 # border-shorthands |
ブラウザーの互換性
BCD tables only load in the browser