CSS outlineProperty


Example

Sets the outline around an element:

p { outline:#0080FF dotted thick; }

Try it Yourself »

Property definition and usage instructions

The outline is a line drawn around an element, outside the border edge, and serves to highlight the element.

The outline shorthand property sets all outline properties in one declaration.

The properties that can be set are (in order): outline-color, outline-style, outline-width

If one of the values is not set, there is no problem; for example, outline:solid #ff0000; is also allowed.

Default value: invert none medium
Inherited: no
version: CSS2
JavaScript Syntax: object.style.outline="#0000FF dotted thin"


Browser Support

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

Property
outline 1.0 8.0 1.5 1.2 7.0

Property value

Value Description
outline-color Specifies the color of the border. See:outline-colorPossible values in.
outline-style Specifies the style of the border. See:outline-stylePossible values in.
outline-width Specifies the width of the border. See:outline-widthPossible values in.
inherit Specifies that the outline property should be inherited from the parent element.


Related Articles

CSS Tutorial:CSS Outline

other extensions