Resources

CSS :checked State Machines: How No-Code Interactive Email Actually Works

Every email client strips <script> tags on arrival, so nothing that looks like a real app inside an email is running JavaScript. It's a hidden radio or checkbox input, a :checked selector, and a sibling combinator doing the work — a technique with real, if uneven, support across today's inbox landscape.

Published August 23, 2026 · By the MailInApp Team

Every major email client strips <script> tags before rendering a message — no exceptions, no per-sender opt-out. So when an email carries a working carousel, an accordion that expands, or a quiz that scores an answer, none of it is JavaScript. It's a hidden checkbox, a CSS selector, and a technique the email-development community calls a state machine.

The problem: email clients strip <script>

Web interactivity almost always assumes JavaScript is available. Email can't make that assumption at all — Gmail, Apple Mail, Outlook, and every other major client removes <script> tags on arrival as a baseline security measure, regardless of what a sender includes or how the message is signed. Anything that behaves like an app inside an email has to be expressible entirely in HTML and CSS, because that's genuinely all that's left standing by the time it renders.

The technique: hidden inputs and sibling combinators

The mechanism is the CSS :checked pseudo-class, applied to real HTML form controls:

  1. A hidden <input type="radio"> or <input type="checkbox"> tracks one piece of state — which carousel slide is active, whether an accordion panel is open, which quiz answer was picked.
  2. A visible <label for="..."> wraps whatever the recipient should be able to click — a "Next" arrow, an accordion header, a poll option — and toggles the input's checked state on click, with zero script involved; that's native <label>/<input> browser behavior.
  3. A CSS sibling combinator (:checked ~ .panel, :checked + .content) styles other elements based on that input's checked state — showing a slide, expanding a panel, revealing a "you picked B" message.

Stack enough of these — one input per state, one combinator rule per resulting style change — and the result reads as a genuinely stateful interface, built entirely from markup a client's <script>-stripping pass never touches because there's no script to strip.

Real-world support: a client-by-client breakdown

Per caniemail.com's tested client panel:

| Support level | Clients | | --- | --- | | Full support | Gmail (all platforms, since March 2020), Apple Mail (macOS 12.4+ / iOS 13.3+), Yahoo Mail, ProtonMail | | Partial support | Outlook.com, New Outlook, and mobile Outlook ("only supported on type selectors"); Samsung Email (Android 7.0+) | | No support | Classic Windows Outlook (2007–2019); Orange and SFR webmail (strip input elements outright) |

That's a materially different number from the ~91%+ real-world reach The 2026 State of Email Client Rendering reports for kinetic CSS generally — caniemail's figure counts clients equally regardless of how many recipients actually use each one, where the reach number weights by real share of tracked opens. Classic Windows Outlook fails this technique entirely, but it's also a shrinking minority of a market-share bucket Apple Mail alone already dwarfs — which is why weighting by actual usage, not by client count, is the number that should drive a design decision.

What happens where :checked isn't honored

In a client that doesn't support :checked at all, the hidden inputs and extra markup simply render inert — no error, no broken layout, just no interaction. The block falls back to whatever its default markup order shows: the first carousel slide, a closed accordion, a plain static list of quiz options. Designing that fallback deliberately, rather than letting an unsupported client show something half-broken, is the fallback engine's actual job — see How fallbacks work for the full three-tier model this technique sits inside.

Sources

Frequently asked questions

What is a CSS :checked state machine in email?

A pattern where an invisible radio or checkbox <input> tracks which state a block is in (which carousel slide, which accordion panel, which quiz answer), a <label> makes the whole visible control clickable without JavaScript, and a CSS sibling combinator (:checked ~ .panel) shows or hides content based on that input's checked state — pure HTML and CSS, no script.

Why can't interactive emails use JavaScript?

Every major email client strips <script> tags for security before rendering a message, regardless of what the sender includes — so any interaction has to be expressible in HTML and CSS alone if it's going to survive delivery.

Which email clients support the :checked technique?

Per caniemail.com's tested client panel: full support in Gmail (all platforms, since March 2020), Apple Mail (macOS 12.4+/iOS 13.3+), Yahoo Mail, and ProtonMail; partial support in Outlook.com, New Outlook, and mobile Outlook ("only supported on type selectors") and Samsung Email (Android 7.0+); no support in classic Windows Outlook (2007–2019) or Orange/SFR webmail, which strip input elements entirely.

What happens in email clients that don't support :checked?

The hidden inputs and extra markup render inert, and the block falls back to its static state — the first carousel slide, the closed accordion, a plain list of quiz options — rather than breaking or showing broken markup. That static-fallback behavior is the fallback engine's job, not a side effect to work around.

Build for the inboxes that actually matter

Start on the free plan — every interactive block and the full fallback engine are included on every tier.