CSS outline-width Property
Topic: CSS3 Properties ReferencePrev|Next
Description
The outline-width CSS property sets the width of the outline of an element. However in many cases the shorthand CSS propertiey outline is more convenient to use and preferable.
The following table summarizes the usages context and the version history of this property.
| Default value: | medium |
|---|---|
| Applies to: | All elements |
| Inherited: | No |
| Animatable: | Yes. See animatable properties. |
| Version: | CSS 2, 3 |
Syntax
The syntax of the property is given with:
The example below shows the outline-width property in action.
Example
Try this code »p {
outline-style: solid;
outline-width: thick;
}
Note: You must declare the outline-style property before the outline-width property. An element must have outlines before you can set the width of the outline, because the default value of the outline-style property is none.
Property Values
The following table describes the values of this property.
| Value | Description |
|---|---|
thin |
A thin outline. |
medium |
A medium outline. |
thick |
A thick outline. |
| length | A length value in px, em, etc. Negative values are not allowed. |
inherit |
If specified, the associated element takes the computed value of its parent element outline-width property. |
Browser Compatibility
The outline-width property is supported in all major modern browsers.
Basic Support—
|
Further Reading
See tutorial on: CSS outline, CSS Border.
Related properties: outline, outline-style, outline-color.

