CSS Outline

An outline is a line drawn around an element, located on the periphery of the border edge, and can play a role in highlighting the element.

The outline attribute specifies the style, color, and width of the element outline.

Outline example

Draw a line around the element
of the present Example demonstrates the use of the outline property draw a line around the 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 (outline)

An outline is a line drawn around an element, located on the periphery of the border edge, and can play a role in highlighting the element.

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

All CSS outline properties

The number in the “CSS” column indicates which CSS version defines the property (CSS1 or CSS2).

Attributes Description value CSS
outline Set all contour properties in one statement outline-color
outline-style
outline-width
inherit
2
outline-color Set the color of the outline color-name
hex-number
rgb-number
invert
inherit
2
outline-style Set the style of the outline none
dotted
dashed
solid
double
groove
ridge
inset
outset
inherit
2
outline-width Set the width of the outline thin
medium
thick
length
inherit
2