Style borderBottomプロパティ
Style オブジェクト
定義と用法
borderBottom プロパティは、3つの独立した下枠線プロパティをショートハンド形式で設定または返します。
このプロパティを使用すると、以下を設定/返すことができます:
- border-bottom-width
- border-bottom-style
- border-bottom-color
構文
borderBottom プロパティを設定:
Object.style.borderBottom="width style color"
borderBottom プロパティを返す:
Object.style.borderBottom
ヒント:borderBottom プロパティにはデフォルト値がありません。
| パラメータ | 説明 |
|---|---|
| width | 下枠線の幅を設定します。 |
| style | 下枠線のスタイルを設定します。 |
| color | 下枠線の色を設定します。 |
ブラウザサポート
![]()
![]()
![]()
![]()
![]()
すべての主要ブラウザが borderBottom プロパティをサポートしています。
例
例
下枠線の幅、スタイル、色を変更する:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>サンプル(example.com)</title>
<style type="text/css">
#ex1{
border: thin dotted #FF0000;
}
</style>
<script>
function displayResult(){
document.getElementById("ex1").style.borderBottom="thick solid #0000FF";
}
</script>
</head>
<body>
<div id="ex1">これはいくつかのテキストです。</div>
<br>
<button type="button" onclick="displayResult()">修改底部边框</button>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>サンプル(example.com)</title>
<style type="text/css">
#ex1{
border: thin dotted #FF0000;
}
</style>
<script>
function displayResult(){
document.getElementById("ex1").style.borderBottom="thick solid #0000FF";
}
</script>
</head>
<body>
<div id="ex1">これはいくつかのテキストです。</div>
<br>
<button type="button" onclick="displayResult()">修改底部边框</button>
</body>
</html>
試してみる »
Style オブジェクト その他の拡張