XML technologies / CSS / Advanced websites with CSS / CSS property reference / outline-color

(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)

An element’s outline (outline) is similar to its border (border). However, it occupies no space in the CSS box model and therefore does not affect other elements’ positions. Also, outline does not create a rectangular box around the element, but follows the irregular edge of a paragraph. Unlike its border, the outline of a multiline inline element always extends from the start to the end of each line.

The property outline-color describes the outline’s colour.

Inherited: no

See also: border-color

Values

Any valid CSS colour value or invert (uses the opposite of the background colour)

Default value: invert (black in all current browsers)

Compatibility

CSS version: 2

Works only in Internet Explorer 5 for Macintosh and Opera 7, and, contrary to the CSS2 specification, only as a rectangular outline. Both browsers use black as the default because they do not support invert.

Example

The following example creates a red outline around hyperlinks when the mouse pointer is over them:

a:hover {
 outline-style: solid;
 outline-color: red;
}

  

 

 

 

back to top