The CSS outline property draws a line around an element, similar to border, but it does NOT take up layout space. It's commonly used for focus indicators, layout debugging, and visual emphasis.
Outline vs Border:
• Outline does not affect layout — it won't change element size or shift surrounding elements
• Outline does not follow border-radius (always rectangular)
• Outline supports negative offset values (draws inside the element)
• Outline is uniform on all sides — you can't set per-side values
• Outline is commonly used with :focus-visible for custom focus styles
Generate with the CSS Outline Generator in three easy steps:
Yes. Outline draws outside the border (or inside with negative offset). This is great for adding a focus ring on top of an existing border.
Use outline: none but always replace it with a custom focus style for accessibility: :focus-visible { outline: 2px solid #06b6d4; outline-offset: 2px; }
Yes. A negative offset draws the outline inside the element, which can create an inner border effect.