splitforms.com
guide · html forms

HTML Form Design — Modern Patterns for 2026

Modern HTML form design is mostly subtraction — single-column vertical layout, generous spacing, visible labels above inputs, native validation styling, dark mode by default. The form below ships these conventions, pre-wired to splitforms.

html
<style>
  .sf-form {
    display: grid; gap: 16px;
    max-width: 480px; margin: 0 auto;
    font-family: ui-sans-serif, system-ui;
  }
  .sf-form label { display: grid; gap: 6px; font-size: 14px; color: #1a1a1a; }
  .sf-form input, .sf-form textarea {
    padding: 11px 14px;
    font-size: 15px;
    border: 1px solid #d4d4d4;
    border-radius: 10px;
    background: #fff;
    transition: border-color 120ms, box-shadow 120ms;
  }
  .sf-form input:focus, .sf-form textarea:focus {
    outline: none;
    border-color: #ff4f00;
    box-shadow: 0 0 0 3px rgba(255,79,0,0.15);
  }
  .sf-form button {
    padding: 12px 20px;
    font-size: 15px; font-weight: 600;
    background: #1a1a1a; color: #fafaf7;
    border: 0; border-radius: 999px;
    cursor: pointer;
  }
  @media (prefers-color-scheme: dark) {
    .sf-form { color: #fafaf7; }
    .sf-form input, .sf-form textarea {
      background: #1a1a1a; color: #fafaf7; border-color: #333;
    }
  }
</style>

<form class="sf-form"
      action="https://splitforms.com/api/submit" method="POST">
  <input type="hidden" name="access_key" value="YOUR_ACCESS_KEY" />
  <label>Name<input name="name" required /></label>
  <label>Email<input name="email" type="email" required /></label>
  <label>Message<textarea name="message" rows="4" required></textarea></label>
  <input type="checkbox" name="botcheck" style="display:none" tabindex="-1" />
  <button type="submit">Send message</button>
</form>

Modern HTML form design has converged on a small set of conventions. Single-column vertical layout — multi-column forms slow scanning and confuse mobile reflow. Visible labels above inputs (not placeholder-only) — placeholder text disappears on focus, breaking accessibility and creating UX dead zones. Generous spacing (16-20px between fields) — cramped forms read as low-trust.

Native validation styling using CSS pseudo-classes: `:valid` and `:invalid` apply automatically based on the input's validity state. Combined with `:focus` and `:placeholder-shown`, you can build a polished error UI with zero JavaScript. The form above uses border-color and box-shadow on focus; you can layer `:invalid:not(:placeholder-shown)` for inline error highlighting after the user has typed.

Dark mode via `prefers-color-scheme` is the 2026 default — every modern browser supports it, most visitors have a preference set. The CSS above flips the form's color tokens inside a `@media (prefers-color-scheme: dark)` block. No JavaScript theme switcher, no library.

Accessibility-first design isn't a separate concern — it's baked into the conventions. Visible labels work for screen readers automatically. Sufficient color contrast (4.5:1 minimum) is just good design. Native focus rings (or styled equivalents) keep keyboard users oriented. The form is faster to design *and* more accessible than the alternative.

How to set this up

Step 01

Single column, vertical stack

grid display, 16-20px gap. Multi-column complicates mobile and slows scanning.

Step 02

Labels above inputs

Visible <label>, not placeholder-only. Screen readers and humans both win.

Step 03

Native focus + validation states

:focus, :valid, :invalid pseudo-classes give you a polished error UI without JS.

Step 04

Dark mode via prefers-color-scheme

One @media block flips your color tokens. No theme switcher required.

Single column, labels above, focus rings, dark mode — five rules, polished form.

Frequently asked questions

What's the best layout for HTML forms?

Single-column vertical for most use cases. Multi-column only when you have many short related fields (first/last name, city/state/zip) and screen real estate is wide. Mobile reverts to single-column anyway via CSS Grid auto-fit.

Should I use placeholder text instead of labels?

No. Placeholders disappear on focus and during input — users lose context for what each field is. Visible <label> elements above inputs are the modern default; placeholder text is supplementary.

How do I style :valid and :invalid inputs?

Apply CSS to `input:valid` and `input:invalid`. Combine with `:not(:placeholder-shown)` to delay error styling until the user has typed something: `input:invalid:not(:placeholder-shown) { border-color: red; }`. No JavaScript required.

Do I need dark mode for a contact form?

Recommended in 2026 — system dark mode is ubiquitous and a contact form that looks broken in dark mode signals 'unfinished'. Implementation is one CSS media query, no JS.

What's the right border-radius for form inputs?

8-12px in 2026. Pill-shaped buttons (border-radius: 999px) read modern; pill-shaped inputs read playful. Most professional contexts use 8-12px on inputs and 999px on the primary submit button.

Related guides

HTML forms

HTML Form — How to Build and Submit Forms in HTML

HTML forms

Free HTML Form Templates — Copy-Paste Ready (2026)

HTML forms

HTML Form Code — Production-Ready Snippets for 2026

Ship the form, not the backend.

Free for 1,000 submissions/month. Email delivery, AI spam filtering, signed webhooks, real dashboard — all on the free plan. No credit card.

Get a free access key →