Style outlineWidth Property
The Style object
Definition and Usage
The outlineWidth property sets or returns the width of the outline around an element.
Syntax
Set the outlineWidth property:
Object.style.outlineWidth="thin|medium|thick|
length
|inherit"
Return the outlineWidth property:
Object.style.outlineWidth
| Value | Description |
|---|---|
| thin | Defines a thin outline. |
| medium | Default. Defines a medium outline. |
| thick | Defines a thick outline. |
| length | Defines the width of the outline using units such as px, cm, etc. |
| inherit | The width of the outline is inherited from the parent element. |
Browser support





All major browsers support the outlineWidth property.
**Note:** IE7 and earlier versions do not support the outlineWidth property. IE8 supports the outlineWidth property only if a !DOCTYPE is specified. IE9 supports the outlineWidth property.
Tips and Notes
An outline is a line drawn around an element. It is displayed around the margin of an element. However, it differs from the border property.
An outline is not part of an element's dimensions, so the element's width and height properties do not include the width of the outline.
Example
Example
Change the width of the outline:
Try it »
The Style object