CSS outline-style Property

Description

The outline-style property sets the style of the outline of an element. An outline is a line that is drawn around elements, outside the border edge, to make the element stand out.

Initial value
none
Applies to
All elements
Inherited
No
Media
Visual
Computed value
Specified value
Animatable
No
CSS Version
CSS2, CSS3
JavaScript syntax
object.style.outlineStyle

Syntax

Formal syntax: auto | <border-style> | inherit

outline-style: [value];

Values

  • noneOutline is not drawn, color and width are ignored.
  • dottedA series of round or square dots.
  • dashedThe outline is a series of short line segments.
  • solidThe outline is a single line.
  • doubleThe outline is two single lines. The outline-width is the sum of the two lines and the space between them.
  • grooveLooks as if it were carved in the canvas. (This is typically achieved by creating a "shadow" from two colors that are slightly lighter and darker than the outline-color.)
  • ridgeThe opposite of groove the outline looks as though it were coming out of the canvas.
  • insetThe outline makes the box look as though it were embeded in the canvas.
  • outsetThe opposite of inset the outline makes the box look as though it were coming out of the canvas.
  • inherit

Example

.class {
   outline-style: dashed;
}

Browser Support

Desktop
Explorer Edge Chrome Firefox Opera Safari
8121?71.2
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
218410.111.0