CSS outline-color
Property
Topic: CSS3 Properties ReferencePrev|Next
Description
The outline-color
CSS property sets the color of the outline of an element. However, in many cases the shorthand property outline
is more convenient to use and preferable.
The following table summarizes the usages context and the version history of this property.
Default value: | invert |
---|---|
Applies to: | All elements |
Inherited: | No |
Animatable: | Yes. See animatable properties. |
Version: | CSS 2, 3 |
Syntax
The syntax of the property is given with:
The example below shows the outline-color
property in action.
Example
Try this code »p {
outline-style: solid;
outline-color: #ff0000;
}
Note: You must declare the outline-style
property before the outline-color
property. An element must have outlines before you can set the color of the outline, because the default value of outline-style
property is none
.
Property Values
The following table describes the values of this property.
Value | Description |
---|---|
color | Specifies the color of the outline. Look at CSS Color Values for the list of possible color values. |
invert |
Performs a color inversion on the pixels of the screen to ensures that the outline is visible, regardless of any background colors. This is default. |
initial |
Sets this property to its default value. |
inherit |
If specified, the associated element takes the computed value of its parent element outline-color property. |
Browser Compatibility
The outline-color
property is supported in all major modern browsers.
Basic Support—
|
Further Reading
See tutorial on: CSS outline, CSS Border.
Related properties: outline
, outline-width
, outline-style
.