スタイルoutlineColorプロパティ
例
<div>要素のアウトラインの色を変更します。
document.getElementById("myDiv").style.outlineColor = "#00ff00";
定義と使用法
outlineColorプロパティは、要素の周囲のアウトラインの色を設定または返します。
アウトラインは、要素の周りの線です。要素の余白の周りに表示されます。ただし、borderプロパティとは異なります。
アウトラインは要素の寸法の一部ではないため、要素の幅と高さのプロパティにはアウトラインの幅が含まれていません。
ブラウザのサポート
Property | |||||
---|---|---|---|---|---|
outlineColor | Yes | Yes | Yes | Yes | Yes |
構文
outlineColorプロパティを返します。
object.style.outlineColor
outlineColorプロパティを設定します。
object.style.outlineColor = "color|invert|initial|inherit"
プロパティ値
Value | Description |
---|---|
color | Specifies the color of the outline. Look at CSS Color Values for a complete list of possible color values |
invert | Inverts the color of the outline to the opposite value. Note: Browsers are not required to support this value |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
技術的な詳細
デフォルト値: | 反転 |
---|---|
戻り値: | 要素のアウトラインの色を表す文字列 |
CSSバージョン | CSS2 |
その他の例
例
<div>要素の境界線の色を返します。
alert(document.getElementById("myDiv").style.outlineColor);
関連ページ
CSSチュートリアル:CSSの概要
CSSリファレンス:outline-colorプロパティ
HTML DOMリファレンス:アウトラインプロパティ
❮スタイルオブジェクト