Style outlineColor Property
- 上一页 outline
- 下一页 outlineOffset
- 返回上一层 Object ng HTML DOM Style
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 do not include the outline width.
See Also:
CSS Tutorial:CSS 轮廓
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 outline color 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 |
支持 | 支持 | 支持 | 支持 | 支持 |
- 上一页 outline
- 下一页 outlineOffset
- 返回上一层 Object ng HTML DOM Style