CSS
CSS OutlineCSS Outline
CSS outlines draw a line outside the border.
Read Time
5 min readDifficulty
BeginnerLast Updated
Jun 15, 2026Version
v1.0.0Introduction
CSS draws outlines outside an element's border to make it stand out. Unlike borders, outlines do not take up space or affect the layout of surrounding elements. Browsers use outlines to highlight focused inputs.
Syntax
Syntax
Example
Example
Key Points
- Outlines sit completely outside the border.
- Outlines do not affect the element's physical size.
- Outlines can overlap other elements.
- The `outline-offset` property adds space before the outline.