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

outline-style: auto | <border-style> | inherit

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

<div class="block">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</div> 
.block { 
   outline-style: dotted; 
   outline-width: 3px; 
   outline-color: blue;
   padding: 10px; 
}

Browser Support

Desktop
Explorer Edge Chrome Firefox Opera Safari
81211.571.2
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
218410.111.0

Last updated by CSSPortal on: 3rd November 2019