CSS outline-colorProperty
Example
Sets the color of a dashed outline:
p
{
outline-style:dotted;
outline-color:#0080FF;
}
{
outline-style:dotted;
outline-color:#0080FF;
}
Try it Yourself »
Property Definition and Usage
An outline is a line drawn around an element, outside the border edge.
The outline-color property specifies the color of an outline.
Note:Always declare the outline-style property before the outline-color property. An element must have an outline before you can change its outline color.
| Default value: | invert |
|---|---|
| Inherited: | no |
| version: | CSS2 |
| JavaScript Syntax: | object.style.outlineColor="#0080FF" |
Browser Support
The numbers in the table indicate the first browser version that supports the property.
| Property | |||||
|---|---|---|---|---|---|
| outline-color | 1.0 | 8.0 | 1.5 | 1.2 | 7.0 |
Tips and notes
Outline surrounds the element. It is the margin around the element. However, it comes from a different border property.
Outline is not part of the element's dimensions, so the element's width and height properties do not include the outline width.
Property value
| Value | Description | |
|---|---|---|
| color | Specifies the outline color. SeeCSS Color Valuesfor a complete list of color values. | |
| invert | Default. Performs color inversion (reverse colors). Makes the outline visible on different background colors. | |
| inherit | Specifies that the outline color should be inherited from the parent element. |
Related Articles
CSS Tutorial:CSS Outline
CSS Reference Manual:outline property
other extensions