CSS outline-width Property

CSS outline-width property specifies the width of the outline of an element.

Usages

The following table outline the usages and version history of this property.

Default value: medium
Applies to: All elements
Inherited: No
Version: CSS2
JavaScript Syntax: object.style.outlineWidth = "5px"

Syntax

Here is a syntax for the CSS outline-width property

outline-width: medium | thin | thick | length | initial | inherit;

Property Values

The following table describes the values of this property.

Value Description
medium Default. Set a medium outline
thin Set a thin outline
thick Set a thick outline
length Set length value in px, pt, cm, em, etc that define outline thickness
initial Sets default value of this property
inherit Inherits this property from its parent element

Examples

The example below shows to sets outline width.

.outline-1 {
  outline-width: medium;
}
.outline-2 {
  outline-width: thin;
}
.outline-3 {
  outline-width: thick;
}
.outline-4 {
  outline-width: 5px;
}
.outline-5 {
  outline-width: 5px 10px;
}
.outline-6 {
  outline-width: 5px 10px 2px;
}

Run it...   »

Browser Compatibility

  • Google Chrome 1+
  • Mozilla Firefox 1+
  • Internet Explorer 4+
  • Opera 3.5+
  • Safari 1+

Note: Here details of browser compatibility with version number may be this is bug and not supported. But recommended to always use latest Web browser.