Open In App

What is the purpose of the outline Property in CSS ?

The outline property in CSS is used to set the style, color, and width of an outline around an element. It is often used to highlight elements without affecting their layout, providing a visible focus or emphasis.

Syntax:

/* Applying a red dotted outline to focused elements */
:focus {
  outline: 2px dotted red;
}

Features

Article Tags :