スタイルborderRightプロパティ
例
<div>要素に右の境界線を追加します。
document.getElementById("myDiv").style.borderRight = "thick solid #0000FF";
定義と使用法
borderRightプロパティは、最大3つの個別のborder-rightプロパティを省略形で設定または返します。
このプロパティを使用すると、次の1つ以上を(任意の順序で)設定/返すことができます。
- border-right-width
- ボーダーライトスタイル
- ボーダー-右-色
ブラウザのサポート
Property | |||||
---|---|---|---|---|---|
borderRight | Yes | Yes | Yes | Yes | Yes |
構文
borderRightプロパティを返します。
object.style.borderRight
borderRightプロパティを設定します。
object.style.borderRight = "width style color|initial|inherit"
プロパティ値
Parameter | Description |
---|---|
width | Sets the width of the right border |
style | Sets the style of the right border |
color | Sets the color of the right 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.borderLeft = "thin dotted red";
例
<div>要素のborder-rightプロパティ値を返します。
alert(document.getElementById("myDiv").style.borderLeft);
関連ページ
CSSチュートリアル:CSS Border
CSSリファレンス:border-rightプロパティ
HTML DOMリファレンス:borderプロパティ