Style outlineColor Property
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





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:
Note: For IE8 and earlier versions to support the outline property, a !DOCTYPE must be declared.
Try it »
The Style object