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

CSS outline Property

CSS outline


An outline is a line drawn around an element, outside the border edge, which can serve to highlight the element.

The outline property specifies the style, color, and width of an element's outline.


outline Examples

Draw a line around an element
This example demonstrates using the outline property to draw a line around an element.

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

Set the color of the outline
This example demonstrates how to set the color of the outline.

Set the width of the outline
This example demonstrates how to set the width of the outline.


CSS outline

An outline is a line drawn around an element, outside the border edge, which can serve to highlight the element.

The CSS outline property specifies the style, color, and width of an element's outline.


All CSS outline properties

The number in the "CSS" column indicates which CSS version defined the property (CSS1 or CSS2).

property Description Value CSS
outline Set all the outline properties in a single declaration *outline-color

outline-style
outline-width
*inherit | 2 | | outline-color | Sets the outline color | *color-name
hex-number
rgb-number
*invert
inherit | 2 | | outline-style | Sets the outline style | none
dotted
dashed
solid
double
groove
ridge
inset
outset
inherit | 2 | | outline-width | Sets the outline width | thin
medium
thick
*length
*inherit | 2 |