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
The perfect solution for professionals who need to balance work, family, and career building.
More than 10 000 certificates already issued!
The HTML Certificate documents your knowledge of HTML.
The HTML5 Certificate documents your knowledge of advanced HTML5.
The CSS Certificate documents your knowledge of advanced CSS.
The JavaScript Certificate documents your knowledge of JavaScript and HTML DOM.
The jQuery Certificate documents your knowledge of jQuery.
The XML Certificate documents your knowledge of XML, XML DOM and XSLT.
The ASP Certificate documents your knowledge of ASP, SQL, and ADO.
The PHP Certificate documents your knowledge of PHP and SQL (MySQL).
Your message has been sent to W3Schools.