Color · Made a little simpler

Outline Generator

Set outline width, style, color and offset. Compare a border, or open Focus indicator tester to check contrast against adjacent colors and the area changed by the ring.

Free to useNo account neededProcessed on your device
Your workspaceProcessed on your device

Outline and border preview

Outline
Outline sample
Border
Border sample

Focus Start here, then press Tab to test the ring.

Contrast against surrounding fill
6.89 to 1
Contrast against control fill
7.26 to 1
Outline
Comparison border

Generated stylesheet

Add this tool to your website

Paste this code into your page to add the tool and a visible ToolMellow credit link.

HTML embed code
Preview embed

Outline Generator: how to use it

  1. Enter an outline style, width and color. Set the offset to move the stroke toward or away from the button’s edge.
  2. Compare the outline and border samples. Open Focus indicator tester to check a solid ring against its surrounding colors and measure the area changed on focus.
  3. Choose Keyboard focus or Always visible, then copy or download the stylesheet.

Limits and notes

Outline widths range from 0 to 14 px and offsets from −14 to 18 px. Colors are sRGB. The focus tester models a solid ring using the entered box and background colors. Rounded outlines use estimated area. Verify clipping and the actual keyboard experience in your application.

How your privacy works →

Outline Generator: common questions

Do I need padding or margin to make room for an outline?

An outline does not add space to the box. Give it visual clearance from nearby elements and check any clipping ancestors when you apply the rule.

What does a negative outline offset do?

It draws the outline inward. When the offset is negative by more than the stroke width, the painted stroke sits inside the element edge in the sample.

Does the displayed contrast establish focus accessibility?

It measures blended solid colors against each preview fill. Verify the actual focused control with keyboard navigation, surrounding content and the theme in which it appears.

Guides