Easy Tutorial
❮ Css3 Pr Overflow X Css3 Pr Tab Size ❯

CSS outline Property

Example

Set the outline around an element:

p {
    outline: #00FF00 dotted thick;
}

Property Definition and Usage

The outline is a line drawn around elements, outside the border edge, to make the element stand out.

The outline shorthand property sets all the 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, it does not cause any issues. 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 specify the first browser version that fully supports the property.

Property Chrome IE Firefox Safari Opera
outline 1.0 8.0 1.5 1.2 7.0

Property Values

Value Description
outline-color Specifies the color of the outline. See: outline-color
outline-style Specifies the style of the outline. See: outline-style
outline-width Specifies the width of the outline. See: outline-width
inherit Specifies that the outline properties should be inherited from the parent element.

Related Articles

CSS Tutorial: CSS Outline

❮ Css3 Pr Overflow X Css3 Pr Tab Size ❯