Style borderRightプロパティ
Style オブジェクト
定義と使い方
borderRight プロパティは、3つの独立した右枠線プロパティを省略形式で設定または返します。
このプロパティを使用して、次のものを設定/返すことができます:
- border-right-width
- border-right-style
- border-right-color
構文
borderRight プロパティを設定する:
Object.style.borderRight="width style color"
borderRight プロパティを返す:
Object.style.borderRight
ヒント:borderRight プロパティにはデフォルト値はありません。
| パラメータ | 説明 |
|---|---|
| width | 右枠線の幅を設定します。 |
| style | 右枠線のスタイルを設定します。 |
| color | 右枠線の色を設定します。 |
ブラウザサポート
![]()
![]()
![]()
![]()
![]()
すべての主要ブラウザが borderRight プロパティをサポートしています。
例
例
右枠線の幅、スタイル、色を変更する:
<!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.borderRight="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.borderRight="thick solid #0000FF";
}
</script>
</head>
<body>
<div id="ex1">これはいくつかのテキストです。</div>
<br>
<button type="button" onclick="displayResult()">修改右边框</button>
</body>
</html>
試してみる »
Style オブジェクト その他の拡張