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

HTML DOM Style outlineColor Property

Style outlineColor Property

Style Object Reference The Style object


Definition and Usage

The outlineColor property sets or returns the color of the outline around an element.

Syntax

Set the outlineColor property:

Object.style.outlineColor="

color

|invert|inherit"

Return the outlineColor property:

Object.style.outlineColor

Value Description
color Specifies the color of the outline. In A CSS color value the CSS color reference you can find a complete list of possible color values.
invert Default. Inverts the color of the outline to the opposite value.
inherit The color of the outline is inherited from the parent element.

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the outlineColor property.

**Note:** IE7 and earlier versions do not support the outlineColor property. IE8 supports the outlineColor property only if a !DOCTYPE is specified. IE9 supports the outlineColor 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 color of the outline:

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

Note: For IE8 and earlier versions to support the outline property, a !DOCTYPE must be declared.

Try it »


Style Object Reference The Style object