CSS outline Property

CSS outline property sets the width, style, and color of an element’s outline.  An outline is a line that is drawn outside the borders of an element for decoration purposes.

The outline property is a shorthand of the following three properties:


  outline: 10px dotted blue;
  outline: 5px dashed hotpink;

CSS Syntax

The outline property has the below syntax:

outline: outline-width outline-style outline-color|initial|inherit;

Property Values

The outline property accepts the following values:

outline-widthSpecifies the thickness of the outline.
outline-styleSpecifies the style of the outline.
outline-colorSpecifies the color of the outline.
initialSets the outline property to its default value.
inheritInherits the outline property from the parent element.

General Info

Default Valuemedium none invert
JavaScript Usageelement.style.outline = “10px dotted blue”;