CSS3 outline-offset Property


Example

Specify an outline 15px outside the border edge:

div {
    border: 2px solid black;
    outline: 2px solid red;
    outline-offset: 15px;
}

Try it yourself »

Definition and Usage

The outline-offset property offsets an outline, and draws it beyond the border edge.

Outlines differ from borders in two ways:

  • Outlines do not take up space
  • Outlines may be non-rectangular
Default value: 0
Inherited: no
Animatable: yes, see individual properties. Read about animatable Try it
Version: CSS3
JavaScript syntax: object.style.outlineOffset="15px" Try it


Browser Support

The numbers in the table specify the first browser version that fully supports the property.

Property
outline-offset 4.0 Not supported 3.5 3.1 10.5


CSS Syntax

outline-offset: length|initial|inherit;

Property Values

Value Description
length The distance the outline is outset from the border edge. Default value is 0
initial Sets this property to its default value. Read about initial
inherit Inherits this property from its parent element. Read about inherit


Related Pages

CSS3 tutorial: CSS3 User Interface

HTML DOM reference: outlineOffset property



Color Picker

colorpicker