Default HTML <input> styling varies wildly across Chrome, Safari, and Firefox. With just 15 lines of vanilla CSS and semantic variables, you can create sharp, responsive form inputs that look polished in both light and dark themes.

Open Interactive CSS Input Style Generator
Customize borders, radii, focus shadows, and copy HTML + CSS immediately

Production CSS Input & Focus Ring Snippet

.field-input {
  width: 100%;
  padding: 0.62rem 0.85rem;
  font-size: 1rem;
  color: var(--text, #0f172a);
  background: var(--bg, #ffffff);
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field-input:focus-visible {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

4 Accessibility & Polish Rules

Frequently Asked Questions

Why use box-shadow instead of increasing border thickness on focus?

Keeping border width fixed at 1.5px and adding a diffused 3px box-shadow glow prevents layout wobble when focusing adjacent fields.

Should placeholders be styled lightly?

Keep contrast legible (at least `#64748b` on white) and avoid treating placeholders as labels.