Style outline Property
Definition and Usage
The outline property sets or returns all the outline properties in a shorthand form.
Syntax
Set the outline property:
Return the outline property:
Note: The outline property has no default value.
| Parameter | Description |
|---|---|
| width | Sets the width of the outline. |
| style | Sets the style of the outline. |
| color | Sets the color of the outline. |
| inherit | Specifies that the outline properties should be inherited from the parent element. |
Browser Support
All major browsers support the outline property.
Note: IE7 and earlier versions do not support the outline property. IE8 only supports the outline property if the !DOCTYPE is specified. IE9 supports the outline property.
Tips and Notes
An outline is a line drawn around elements, outside the border edge. It is displayed around the margin of the element, but it is different from the border property.
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.
Example
Change the width, style, and color of the outline around a div element: