CSSボーダー右プロパティ
例
さまざまな要素の右枠のスタイルを設定します。
h1 {
border-right: 5px solid red;
}
h2 {
border-right: 4px dotted blue;
}
div {
border-right: double;
}
定義と使用法
border-right
プロパティは、(次の順序で)の省略形のプロパティです。
border-right-colorを省略した場合、適用される色はテキストの色になります。
デフォルト値: | ミディアムなしカラー |
---|---|
遺伝性の: | いいえ |
アニメート可能: | はい、個々のプロパティを参照してください。アニメート可能について読む |
バージョン: | CSS1 |
JavaScript構文: | object .style.borderRight = "5pxドットブルー" |
ブラウザのサポート
表の数字は、プロパティを完全にサポートする最初のブラウザバージョンを示しています。
Property | |||||
---|---|---|---|---|---|
border-right | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
CSS構文
border-right: border-width border-style border-color|initial|inherit;
プロパティ値
Value | Description |
---|---|
border-right-width | Required. Specifies the width of the right border. Default value is "medium" |
border-right-style | Required. Specifies the style of the right border. Default value is "none" |
border-right-color | Optional. Specifies the color of the right border. Default value is the color of the text |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
関連ページ
CSSチュートリアル:CSS Border
HTML DOMリファレンス:borderRightプロパティ