CSS outline-widthProperty


Example

Set the outline width:

p { outline-style:dotted; outline-width:5px; }

Try it Yourself »

Property definition and usage instructions

An outline is a line drawn around an element, outside the border edge.

outline-width specifies the width of the outline.

Note:Always declare the outline-style property before the outline-width property. An element must have an outline before you can change the width of its outline.

Default value: medium
Inherited: no
version: CSS2
JavaScript Syntax: object.style.outlineWidth="thin"


Browser Support

The numbers in the table specify the first browser version that fully supports the property.

Property
outline-width 1.0 8.0 1.5 1.2 7.0

Tips and notes

An outline is drawn around an element. It is around the element's margin. However, it is different from the border properties.

An outline is not part of the element's dimensions, so the element's width and height properties do not include the outline width.


Property value

Value Description
thin Specify thin outline.
medium Default. Specifies a medium outline.
thick Specify thick outline.
length Allows you to specify a value for outline thickness.
inherit Specifies that the outline width should be inherited from the parent element.


Related Articles

CSS Tutorial:CSS Outline

CSS Reference Manual:outline property

other extensions