Style outlineColor Property
- Previous Page outline
- Next Page outlineOffset
- Go Up One Level HTML DOM Style Object
Definition and Usage
outlineColor
Sets or returns the color of the outline around the element.
The outline is a line around the element. It is displayed around the element's margin. However, it is not the same as border property Different.
The outline is not part of the element's size, so the width and height properties of the element do not include the outline width.
See also:
CSS Tutorial:CSS Outline
CSS Reference Manual:outline-color property
HTML DOM Reference Manual:outline property
Example
Example 1
Change the outline color of the <div> element:
document.getElementById("myDiv").style.outlineColor = "#00ff00";
Example 2
Returns the border color of the <div> element:
alert(document.getElementById("myDiv").style.outlineColor);
Syntax
Return outlineColor property:
object.style.outlineColor
Set outlineColor property:
object.style.outlineColor = "color|invert|initial|inherit"
Property value
Value | Description |
---|---|
color |
Specifies the outline color. See CSS Color Values, for a complete list of possible color values. |
invert | Reverses the color of the outline to its opposite value. Default. |
initial | Sets this property to its default value. See initial. |
inherit | Inherits this property from its parent element. See inherit. |
Technical details
Default value: | invert |
---|---|
Return value: | A string that represents the color of the element's outline. |
CSS Version: | CSS2 |
Browser support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support |
- Previous Page outline
- Next Page outlineOffset
- Go Up One Level HTML DOM Style Object