Easy Tutorial
❮ Pr Object Fit Pr Text Word Spacing ❯

CSS outline-color Property

Example

Set the color of a dashed outline:


Property Definition and Usage

The outline is a line drawn around elements, outside the border edge.

The outline-color property specifies the color of the outline.

Note: Always declare the outline-style property before the outline-color property. An element must have an outline before you can change the color of it.

Default value: invert
Inherited: no
--- ---
Version: CSS2
--- ---
JavaScript syntax: object.style.outlineColor="#00FF00"
--- ---

Browser Support

The numbers in the table specify the first browser version that fully supports the property.

Property
outline-color 1.0 8.0 1.5 1.2 7.0

Tips and Notes

The outline is around the margin of the element. However, it is different from the border properties.

The outline is not part of the element's dimensions, so the element's width and height properties do not include the width of the outline.


Property Values

Value Description
color Specifies the color of the outline. See CSS Color Values
invert Default. Performs a color inversion. Ensures the outline is visible against different background colors.
inherit Specifies that the outline color should be inherited from the parent element.

Related Articles

CSS Tutorial: CSS Outline

CSS Reference: outline Property

❮ Pr Object Fit Pr Text Word Spacing ❯