CSSborder -left-colorプロパティ
例
左の境界線の色を設定します。
div {border-left-color: coral;}
以下の「自分で試してみてください」の例をもっと見てください。
定義と使用法
border-left-color
プロパティは、要素の左境界線の色を設定します。
注:プロパティの前に、常にborder-styleまたは
border-left-style
プロパティを宣言してくださいborder-left-color
。色を変更する前に、要素に境界線が必要です。
デフォルト値: | 要素の現在の色 |
---|---|
遺伝性の: | いいえ |
アニメート可能: | はい。アニメート可能について読む |
バージョン: | CSS1 |
JavaScript構文: | オブジェクト.style.borderLeftColor = "blue" |
ブラウザのサポート
表の数字は、プロパティを完全にサポートする最初のブラウザバージョンを示しています。
Property | |||||
---|---|---|---|---|---|
border-left-color | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
CSS構文
border-left-color: color|transparent|initial|inherit;
プロパティ値
Value | Description | Play it |
---|---|---|
color | Specifies the color of the left border. Look at CSS Color Values for a complete list of possible color values. Default color is the current color of the element | |
transparent | Specifies that the border color should be transparent | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
その他の例
例
HEX値を使用して左の境界線の色を設定します。
div {border-left-color: #92a8d1;}
例
RGB値で左の境界線の色を設定します。
div {border-left-color: rgb(201, 76, 76);}
例
RGBA値で左の境界線の色を設定します。
div {border-left-color: rgba(201, 76, 76, 0.3);}
例
HSL値を使用して左境界線の色を設定します。
div {border-left-color: hsl(89, 43%, 51%);}
例
HSLA値を使用して左境界線の色を設定します。
div {border-left-color: hsla(89, 43%, 51%, 0.3);}
例
透明な左の境界線を設定します。
div {border-left-color: transparent;}
関連ページ
CSSチュートリアル:CSS Border
CSSリファレンス:border-leftプロパティ
HTML DOMリファレンス: borderLeftColorプロパティ