CSSの概要
アウトラインは、要素の境界線の外側に描かれた線です。
CSSの概要
アウトラインは、要素を「目立たせる」ために、境界線の外側で要素の周りに描かれる線です。
CSSには次のアウトラインプロパティがあります。
-
outline-style
-
outline-color
-
outline-width
-
outline-offset
-
outline
注:アウトラインは境界線とは異なります!境界線とは異なり、アウトラインは要素の境界線の外側に描画され、他のコンテンツと重なる場合があります。また、アウトラインは要素の寸法の一部ではありません。要素の合計の幅と高さは、アウトラインの幅の影響を受けません。
CSSアウトラインスタイル
このoutline-style
プロパティは、アウトラインのスタイルを指定し、次のいずれかの値をとることができます。
dotted
-点線の輪郭を定義しますdashed
-破線のアウトラインを定義しますsolid
-しっかりとしたアウトラインを定義しますdouble
-二重のアウトラインを定義しますgroove
- Defines a 3D grooved outlineridge
- Defines a 3D ridged outlineinset
- Defines a 3D inset outlineoutset
- Defines a 3D outset outlinenone
- Defines no outlinehidden
- Defines a hidden outline
The following example shows the different outline-style
values:
Example
Demonstration of the different outline styles:
p.dotted {outline-style: dotted;}
p.dashed {outline-style: dashed;}
p.solid {outline-style: solid;}
p.double {outline-style: double;}
p.groove {outline-style: groove;}
p.ridge {outline-style: ridge;}
p.inset {outline-style: inset;}
p.outset {outline-style: outset;}
Result:
A dotted outline.
A dashed outline.
A solid outline.
A double outline.
A groove outline. The effect depends on the outline-color value.
A ridge outline. The effect depends on the outline-color value.
An inset outline. The effect depends on the outline-color value.
An outset outline. The effect depends on the outline-color value.
Note: None of the other outline properties (which you will learn more about in the next chapters) will have ANY effect unless the
outline-style
property is set!