スタイルoutlineWidthプロパティ
例
<div>要素のアウトラインの幅を変更します。
document.getElementById("myDiv").style.outlineWidth = "10px";
定義と使用法
outlineWidthプロパティは、要素の周囲のアウトラインの幅を設定または返します。
アウトラインは、要素の周りの線です。要素の余白の周りに表示されます。ただし、borderプロパティとは異なります。
アウトラインは要素の寸法の一部ではないため、要素の幅と高さのプロパティにはアウトラインの幅が含まれていません。
ブラウザのサポート
Property | |||||
---|---|---|---|---|---|
outlineWidth | Yes | Yes | Yes | Yes | Yes |
構文
outlineWidthプロパティを返します。
object.style.outlineWidth
outlineWidthプロパティを設定します。
object.style.outlineWidth = "thin|medium|thick|length|initial|inherit"
プロパティ値
Value | Description |
---|---|
thin | Defines a thin outline |
medium | Defines a medium outline. This is default |
thick | Defines a thick outline |
length | The width of the outline in length units |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
技術的な詳細
デフォルト値: | 中くらい |
---|---|
戻り値: | 要素のアウトラインの幅を表す文字列 |
CSSバージョン | CSS2 |
その他の例
例
「thick」値を使用して、<div>要素のアウトラインの幅を変更します。
document.getElementById("myDiv").style.outlineWidth = "thick";
例
<div>要素のアウトラインの幅を返します。
alert(document.getElementById("myDiv").style.outlineWidth);
関連ページ
CSSチュートリアル:CSSの概要
CSSリファレンス:アウトラインプロパティ
HTML DOMリファレンス:アウトラインプロパティ
❮スタイルオブジェクト