Style outlineColor Property
- Halaman Sebelumnya outline
- Halaman Berikutnya outlineOffset
- Kembali ke TINGKAT ATAS Objek Style DOM HTML
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 different from 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:Garis Silang 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 color of the outline. Please 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 |
Dukungan | Dukungan | Dukungan | Dukungan | Dukungan |
- Halaman Sebelumnya outline
- Halaman Berikutnya outlineOffset
- Kembali ke TINGKAT ATAS Objek Style DOM HTML