CSS3 outline-offset property


Specify the outline of the edge of the outer border 15px:

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

Try it out . . .

Browser support

The numbers in the table support the first browser version number of the property.

The number immediately before -webkit-, -ms- or -moz- is the first browser version number that supports the prefix property.

Attributes
outline-offset 4.0 Incompatible 3.5 3.1 10.5

Description of property definition and use

The outline-offset property sets the offset of the outline frame outside the border edge

Outlines differs from borders in two ways:

  • Outlines do not take up space
  • Outlines may not be rectangular
Default: 0
Inherited: no
Version: CSS3
JavaScript syntax: object .style.outlineOffset="15px"


Grammar

outline-offset: length |inherit:

Value Describe
length The distance the outline is from the edge of the border.
inherit Specifies that the value of the outline-offset property should be inherited from the parent element.


Related articles

CSS3 tutorial: CSS3 User Interface