Style borderBottomWidthプロパティ
Style オブジェクト
定義と使い方
borderBottomWidth プロパティは、要素の下枠線の幅を設定または取得します。
構文
borderBottomWidth プロパティを設定する場合:
Object.style.borderBottomWidth="thin|medium|thick|length|inherit"
borderBottomWidth プロパティを取得する場合:
Object.style.borderBottomWidth
| 值 | 説明 |
|---|---|
| thin | 細い枠線を定義します。 |
| medium | デフォルト。中程度の枠線を定義します。 |
| thick | 太い枠線を定義します。 |
| length | px、cm などの単位を使用して枠線の幅を定義します。 |
| inherit | 下枠線の幅は親要素から継承されます。 |
ブラウザサポート
![]()
![]()
![]()
![]()
![]()
すべての主要ブラウザが borderBottomWidth プロパティをサポートしています。
注意:IE7 以前のバージョンは "inherit" 値をサポートしていません。IE8 は !DOCTYPE が指定されている場合のみ "inherit" をサポートします。IE9 は "inherit" をサポートします。
例
例
下枠線の幅を変更する:
<html>
<head>
<style type="text/css">
#ex1
{
border: 1px solid #FF0000;
}
</style>
<script>
function displayResult()
{
document.getElementById("ex1").style.borderBottomWidth="thick";
}
</script>
</head>
<body>
<div id="ex1">This is some text.</div>
<br>
<button type="button" onclick="displayResult()">Change width of bottom border</button>
</body>
</html>
<head>
<style type="text/css">
#ex1
{
border: 1px solid #FF0000;
}
</style>
<script>
function displayResult()
{
document.getElementById("ex1").style.borderBottomWidth="thick";
}
</script>
</head>
<body>
<div id="ex1">This is some text.</div>
<br>
<button type="button" onclick="displayResult()">Change width of bottom border</button>
</body>
</html>
試してみる »
Style オブジェクト その他の拡張