CSS Outline

Last Updated: March 27, 2022

CSS outline is a shorthand property and it is used to draw around the element after the border.

Although the outline is beyond the border it does not take any space like margin or padding.

Outline is beyond the border

This property is a shorthand for the following CSS properties:

Syntax for outline

outline: <outline-color> <outline-style> <outline-width>

You can use the following syntax for outline

/* style */
outline: solid;

/* color | style */
outline: #f66 dashed;

/* style | width */
outline: inset thick;

/* color | style | width */
outline: green solid 3px;

/* Global values */
outline: inherit;
outline: initial;
outline: revert;
outline: unset;