Horje
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

  • Focus Indication: Commonly used to visually indicate focus on interactive elements, improving accessibility.
  • Style Options: The outline property supports various styles, including dotted, dashed, solid, and more.
  • Color: You can set the color of the outline using color values.
  • Width: Specifies the width of the outline, controlling its thickness.



Reffered: https://www.geeksforgeeks.org


CSS

Related
Explain the purpose of the max-width Property Explain the purpose of the max-width Property
What is the use of the CSS pointer-events Property? What is the use of the CSS pointer-events Property?
What is the purpose of the Transition Property in CSS ? What is the purpose of the Transition Property in CSS ?
How to hide an Element using CSS ? How to hide an Element using CSS ?
How to create a Border around an HTML Element using CSS ? How to create a Border around an HTML Element using CSS ?

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
12