スタイルborderBottomプロパティ
例
<div>要素に下の境界線を追加します。
document.getElementById("myDiv").style.borderBottom = "thick solid #0000FF";
以下の「自分で試してみてください」の例をもっと見てください。
定義と使用法
borderBottomプロパティは、最大3つの個別のborder-bottomプロパティを省略形で設定または返します。
このプロパティを使用すると、次の1つ以上を(任意の順序で)設定/返すことができます。
- border-bottom-width
- ボーダーボトムスタイル
- border-bottom-color
ブラウザのサポート
表の数字は、プロパティを完全にサポートする最初のブラウザバージョンを示しています。
Property | |||||
---|---|---|---|---|---|
borderBottom | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
構文
borderBottomプロパティを返します。
object.style.borderBottom
borderBottomプロパティを設定します。
object.style.borderBottom = "width style color|initial|inherit"
プロパティ値
Parameter | Description |
---|---|
width | Sets the width of the bottom border |
style | Sets the style of the bottom border |
color | Sets the color of the bottom border |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
技術的な詳細
デフォルト値: | 指定されていない |
---|---|
戻り値: | 要素の下枠の幅、スタイル、色を表す文字列 |
CSSバージョン | CSS1 |
その他の例
例
<div>要素の下枠の幅、スタイル、色を変更します。
document.getElementById("myDiv").style.borderBottom = "thin dotted red";
例
<div>要素のborder-bottomプロパティ値を返します。
alert(document.getElementById("myDiv").style.borderBottom);
関連ページ
CSSチュートリアル:CSS Border
CSSリファレンス:border-bottomプロパティ
HTML DOMリファレンス:borderプロパティ