CSS outline-width
property sets the thickness of an element’s outline. An outline is a line that is drawn outside the borders of an element for decoration purpose.
The outline-width can be specified using inbuilt CSS keywords like ‘thin’, ‘medium’, ‘thick’ or in any Valid CSS length format such as ‘px’, ’em’, ‘rem’, ‘cm’, etc. Refer to the example below:
Example:
.p1{ outline-width: thick; } .p2{ outline-width: 10px; }
CSS Syntax
The outline-width
property has the below syntax:
outline-width: medium|thin|thick|length|initial|inherit;
Property Values
The outline-width
property accepts the following values:
medium | This is the default value. It sets a medium thickness outline. |
thin | Specifies a thin outline. |
thick | Specifies a thick outline. |
length | Specifies the thickness of outline-width in any valid CSS length format such as ‘px’, ’em’, ‘rem’, ‘cm’, etc. |
initial | Sets the outline-width property to its default value(medium). |
inherit | Inherits the outline-width property from the parent element. |
General Info
Default Value | medium |
Inherited | No |
JavaScript Usage | element.style.outlineWidth = “10px”; |