Set the style of an outline:
An outline is a line that is drawn around elements (outside the borders) to make the element "stand out".
The outline-style property specifies the style of an outline.
| Default value: | none |
|---|---|
| Inherited: | no |
| Version: | CSS2 |
| JavaScript syntax: | object.style.outlineStyle="dotted" |
![]()
The outline-style property is supported in all major browsers.
Note: IE8 supports the outline-style property only if a !DOCTYPE is specified.
An outline is a line around an element. It is displayed around the margin of the element. However, it is different from the border property.
The outline is not a part of the element's dimensions, therefore the element's width and height properties do not contain the width of the outline.
| Value | Description | Play it |
|---|---|---|
| none | Specifies no outline | Play it » |
| dotted | Specifies a dotted outline | Play it » |
| dashed | Specifies a dashed outline | Play it » |
| solid | Specifies a solid outline | Play it » |
| double | Specifies a double outliner | Play it » |
| groove | Specifies a 3D grooved outline. The effect depends on the outline-color value | Play it » |
| ridge | Specifies a 3D ridged outline. The effect depends on the outline-color value | Play it » |
| inset | Specifies a 3D inset outline. The effect depends on the outline-color value | Play it » |
| outset | Specifies a 3D outset outline. The effect depends on the outline-color value | Play it » |
| inherit | Specifies that the outline style should be inherited from the parent element |
Set the style of an outline
This example demonstrates how to set the style of an outline.
CSS tutorial: CSS Outline
CSS reference: outline property
HTML DOM reference: outlineStyle property
Your message has been sent to W3Schools.