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 · Updated November 14, 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 scratch-off card that reveals a prize, none of it is JavaScript. It's a hidden checkbox, a CSS selector, and a technique the email-development community calls a state machine. Email built this way is known as kinetic email: interactive HTML and CSS that runs where a client supports it and falls back to a static version where it doesn't.

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, whether a scratch-off card has been scratched.
  2. A visible <label> wraps whatever the recipient should be able to click — a "Next" arrow, an accordion header, a flashcard — and toggles the input's checked state on click, with zero script involved; that's native <label>/<input> browser behavior. A label can point at its input with for="..." or contain it; containing it is the safer choice, because Yahoo Mail ignores for and only toggles an input that sits inside the tapped label. MailInApp's accordion, flashcards, scratch-off and spin-to-win all put the input inside its label for that reason.
  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 levelClients
Full supportGmail (all platforms, since March 2020), Apple Mail (macOS 12.4+ / iOS 13.3+), Yahoo Mail, ProtonMail
Partial supportOutlook.com, New Outlook, and mobile Outlook ("only supported on type selectors"); Samsung Email (Android 7.0+)
No supportClassic Windows Outlook (2007–2019); Orange and SFR webmail (strip input elements outright)

In MailInApp's own tests in real inboxes (October 2026), several of those entries didn't hold up. Every Gmail app (web, iOS and Android) kept the email's <style> block but dropped the :checked rules, so the blocks showed their fallback. Yahoo Mail ran the rules but ignored <label for>, toggling only an input inside its label. Outlook.com and the Outlook apps for iOS and Android dropped them.

Mail on iPhone and iPad, iCloud Mail on the web and Thunderbird ran them. We haven't measured Apple Mail on macOS, new Outlook for Windows or Samsung Email. The full results are in Email client support.

So don't plan on a single reach percentage for this technique. Market share alone can't give one: Litmus counts Apple Mail on iPhone, iPad and Mac as one bucket, and Gmail, the second-largest client, doesn't run it at all. The 2026 State of Email Client Rendering puts the measured support next to market share. What drives a design decision is that a large share of any real list will see the fallback, so the fallback has to be complete.

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 shows, so that default has to hide nothing. In MailInApp, a carousel shows its first slide and a link to the rest, an accordion shows every item expanded, a flashcard shows both sides, and a scratch-off card shows the prize. 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.

How MailInApp uses it

MailInApp's studio writes this markup for you, and pairs every block with a version that reads complete where the technique isn't honored. How fallbacks work shows each block in every tier, and Email client support lists what each app does. For market share and reach, see The 2026 State of Email Client Rendering.

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, whether a scratch-off card has been scratched), a <label> wrapping it 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. MailInApp's own tests in real inboxes (October 2026) differ: every Gmail app dropped the :checked rules, as did Outlook.com and the Outlook apps for iOS and Android, while Mail on iPhone and iPad, iCloud Mail, Thunderbird and Yahoo Mail ran them (Yahoo only for an input inside its label). Apple Mail on macOS, new Outlook and Samsung Email aren't measured yet.

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

The hidden inputs and extra markup render inert, and the block falls back to a static state that hides nothing — in MailInApp, the first carousel slide plus a link to the rest, every accordion item expanded, both sides of each flashcard, the scratch-off prize — 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.