CSS Outline
Introduction to CSS Outline
The CSS outline is a line drawn around elements outside the border, making it a useful tool for emphasizing content. Unlike borders, outlines do not take up space in the box model.
CSS Outline Properties
- outline-style: Specifies the style of the outline, such as solid, dashed, or dotted.
- outline-color: Sets the color of the outline.
- outline-width: Defines the thickness of the outline.
- outline-offset: Sets the space between the border and the outline.
Example
button {
outline: 2px solid blue;
outline-offset: 5px;
}
Browser Support
Most modern browsers support outline properties.