Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

CSS outline-style property

CSS outline-style property

Example

Set the style of the outline:

p

{

outline-style:dotted;

}

Try it »

There are more examples at the bottom of this page.


Property definition and usage

An outline is a line drawn around an element, outside the border edge.

The outline-style property specifies the style of the outline.

Default value: none
Inherited: no
Version: CSS2
JavaScript syntax: object.style.outlineStyle="dotted"

Browser support

The numbers in the table indicate the first browser version that supports this property.

property
outline-style 1.0 8.0 1.5 1.2 7.0

Tips and Notes

An outline is around the element. It is a margin around the element. However, it comes from a different border property.

An outline is not part of the element's dimensions, so the element's width and height properties do not include the width of the outline.


Attribute values

Value Description
none Default. Defines no outline.
dotted Defines a dotted outline.
dashed Defines a dashed outline.
solid Defines a solid outline.
double Defines a double outline. The width of the double line is equal to the value of outline-width.
groove Defines a 3D grooved outline. The effect depends on the outline-color value.
ridge Defines a 3D groove outline. This effect depends on the outline-color value.
inset Defines a 3D ridge outline. This effect depends on the outline-color value.
outset Defines a 3D outset outline. This effect depends on the outline-color value.
inherit Specifies that the outline style should be inherited from the parent element.

More examples

Set the style of the outline
This example demonstrates how to set the style of an outline.


Related Articles

CSS Tutorial: CSS Outline

CSS Reference Manual: outline property