CSS PROPERTIES
Expand All|Collapse All
CSS AT-RULES
SPONSORED LINKS

CSS outline-color Property

Topic: CSS3 Properties Reference« Prev|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:

outline-color color | invert | initial | inherit

The example below shows the outline-color property in action.

  • 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.

Browsers Icon

Basic Support—

  • Firefox 1.5+
  • Google Chrome 1+
  • Internet Explorer 8+
  • Apple Safari 1.2+
  • Opera 7+
 

Warning:Internet Explorer 7 and earlier versions don't support the outline-color property. IE8 however supports this property, but requires a valid <!DOCTYPE>.


Further Reading

See tutorial on: CSS outline, CSS Border.

Related properties: outline, outline-width, outline-style.

 
Close

Your Feedback:

 

We would love to hear from you! Please say something.