Tool Hub

Focus Ring 测试器

Outline·box-shadow 焦点样式预览

CSS 选择器

仅键盘(推荐)

点击下面的控件或按 Tab 键预览焦点环样式。

CSS
:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

使用方法

  1. Adjust outline width, offset, and color using the numeric inputs and color picker.
  2. Choose outline style: solid, dashed, or dotted.
  3. Optionally enable box-shadow and set its spread and color for a dual-ring effect.
  4. Tab into the preview button or input to see the focus ring rendered live.
  5. Copy the generated CSS to use in your own stylesheet.

示例

  • Setting width 3px, offset 2px, color #0066FF, style solid produces outline: 3px solid #0066FF; outline-offset: 2px; visible on the preview button when focused.
  • Enabling box-shadow with spread 4px and color rgba(0,102,255,0.4) adds a soft glow ring around the outline.

生产环境使用前请验证输出。无担保 — 参见 条款.