Little Web Hut

CSS 2.1 Reference: outline-style Property

CSS outline-style Property
selector {outline-style: value ;}
  • value is specified by using one of the following keywords: none, dotted, dashed, solid, double, groove, ridge, inset, outset, or inherit.

The outline-style property is used to specify the style of the outline. The outline property generates an outline around the content and border area of the element's box. See the Box Model for a description of the boxes that are generated for elements and the relative position of the content area and borders. Unlike the border property, the outline property is displayed on top of the element's box and it does not influence the size or position of the element's box.

This property is specified by using a keyword according to the syntax shown above.

CSS Example: The outline-style property is set to use a dashed line.
h1 {outline-color: red;
    outline-style: dashed;
    outline-width: medium;
Test It HTML StyleTest It XHTML StyleTest It HTML5 Style

  • none - No border.
  • dotted - This is a sample
  • dashed - This is a sample
  • solid - This is a sample
  • double - This is a sample
  • groove - This is a sample
  • ridge - This is a sample
  • inset - This is a sample
  • outset - This is a sample
  • inherit - The inherit keyword is used to specify that the value for this property should be taken from the parent element. If inherit is used with the root element, then the initial value for this property will be used.

Note: The outline samples, shown above, may not appear identically in all browsers.

Applies To All elements
Inherited No
Initial Value none

outline-style Property Examples
Test It HTML StyleTest It HTML StyleTest It HTML5 StyleThe outline-style property is set to use a dashed line.