outline property sets the width, style, and color for all four sides of an element's outline. It is a shorthand property for setting the individual outline properties i.e.
outline-color in a single declaration.
The following table summarizes the usages context and the version history of this property.
|Default value:||See individual properties|
|Applies to:||All elements|
|Animatable:||Yes, as some of the properties of the shorthand are animatable. See animatable properties.|
|Version:||CSS 2, 3|
The syntax of the property is given with:
Note:If any property listed above is missing or omitted, the default value for that property will be inserted, if any. See individual properties for details.
The example below shows the
outline property in action.
ExampleTry this code »
outline: 2px solid #ff0000;
outline-top: 5px solid;
The following table describes the values of this property.
||Sets the width of the outline of an element.|
||Sets the line style of the outline of an element.|
||Sets the color of the outline of an element.|
||Sets this property to its default value.|
||If specified, the associated element takes the computed value of its parent element
outline property is supported in all major modern browsers.
Warning:Internet Explorer 7 and earlier versions don't support the
outline property. IE8 however supports this property, but requires a valid