Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Style outlineStyle Property

Style outlineStyle Property

Style Object Reference The Style object


Definition and Usage

The outlineStyle property sets or returns the style of the outline around an element.

Syntax

Set the outlineStyle property:

Object.style.outlineStyle="

value

"

Return the outlineStyle property:

Object.style.outlineStyle

Value Description
none Default. Defines no outline.
hidden The outline is turned off.
dotted Defines a dotted outline.
dashed Defines a dashed outline.
solid Defines a solid outline.
double Defines a double outline.
groove Defines a 3D grooved outline. The effect depends on the outline-color value.
ridge Defines a 3D ridged outline. The effect depends on the value of border-color.
inset Defines a 3D inset outline. The effect depends on the value of border-color.
outset Defines a 3D outset outline. The effect depends on the value of border-color.
inherit The style of the outline is inherited from the parent element.

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the outlineStyle property.

**Note:** IE7 and earlier versions do not support the outlineStyle property. IE8 supports the outlineStyle property only if a !DOCTYPE is specified. IE9 supports the outlineStyle property.


Tips and Notes

An outline is a line drawn around an element. It is displayed around the margin of an element. However, it differs from the border property.

An outline is not part of an element's dimensions, so the element's width and height properties do not include the width of the outline.


Example

Example

Change the style of the outline:

Runoob Tutorial(runoob.com)
This is some text.

Note: IE8 support for the outline property requires specifying a !DOCTYPE

Try it »


Style Object Reference The Style object