Skip to main content

Our email CSS engine is open source. Give it a star on GitHub 

Emailens

Selector or pseudo-class · data last changed 10 Nov 2026

:attribute-selector in email clients

Works in 6 of 21. Not supported in Outlook Classic and Proton Mail. Partial in Gmail, Gmail Android, Gmail iOS and 9 more. Untested in Superhuman.

Your reader in Outlook Classic sees the email without :attribute-selector, even if it looks right where you tested it.

caniemail (MIT) via @emailens/engine 0.18.22

What to do instead in Outlook Classic

Use attribute selectors only when <style> blocks are preserved. For Outlook coverage, duplicate the styling inline on the matching elements. Treat attribute-based selectors as progressive enhancement, never as the only path to a critical style.

There is no drop-in fix for :attribute-selector in Outlook Classic. Design so the email still reads without it.

The checker needs a computer screen.

A free account opens all 21 clients and keeps your checks for 7 days. Create a free account →

Every account includes one free real-device check in classic Outlook, Outlook for Mac and Apple Mail, after you verify your email and run one preview, while this month's free capacity lasts. How real-device checks work →

:attribute-selector is not among the 24 features we have screenshotted on real installs. The ones we have →

All 21 clients, problems first

ClientSupport
Outlook Classic Not supported
Proton Mail Not supported
Gmail Partial See caveat 1
Gmail Android Partial See caveat 2
Gmail iOS Partial See caveat 2
Outlook 365 Partial See caveat 3
Outlook (New) Partial See caveat 3
Outlook iOS Partial See caveat 4
Outlook Android Partial See caveat 4
Outlook for Mac Partial See caveat 3
Yahoo Mail Partial See caveat 5
Yahoo Mail Android Partial See caveat 5
Yahoo Mail iOS Partial See caveat 5
AOL Mail Partial See caveat 5
Superhuman Untested
Works in 6: Apple Mail, Apple Mail iOS, Samsung Mail and 3 more. Show all
ClientSupport
Apple Mail Works
Apple Mail iOS Works
Samsung Mail Works
Thunderbird Works
HEY Mail Works
Fastmail Works

Caveats (5)

  1. 1. Gmail: Partial. Only supports [attr~=value] syntax. Only class as an attribute name is known to be supported.
  2. 2. Gmail Android, Gmail iOS: Partial. Only supports [attr~=value] syntax. Only class as an attribute name is known to be supported. Partial. Doesn't work with non Google accounts.
  3. 3. Outlook 365, Outlook (New), Outlook for Mac: Partial. Can not be used with a class selector (.test[class]). Must be used solo ([class]) or with an element selector (td[class]). Partial. Only supports [attr], [attr=value], [attr~=value], [attr|=value] syntaxes. Buggy. A class="test" in the HTML is prefixed class="x_test", but an attribute selector stays unprefixed [class="test"].
  4. 4. Outlook iOS, Outlook Android: Partial. Can not be used with a class selector (.test[class]). Must be used solo ([class]) or with an element selector (td[class]). Partial. Only supports [attr], [attr=value], [attr~=value], [attr|=value] syntaxes.
  5. 5. Yahoo Mail, Yahoo Mail Android, Yahoo Mail iOS, AOL Mail: Partial. Only supports [attr=value] syntax.

Caveats as recorded by caniemail (MIT), one entry per wording.

How :attribute-selector behaves

Attribute selectors target elements based on their attributes (e.g., [type=email], [data-id="123"]). Email support is limited because many clients strip <style> blocks where these selectors live. When <style> blocks are preserved, attribute selectors work in modern clients but are ignored in Outlook Classic.

  • Outlook strips <style> blocks, neutralizing attribute selectors.
  • Gmail rewrites class names but preserves attribute selectors when <style> blocks survive.
  • Apple Mail honors attribute selectors reliably across recent macOS and iOS releases.

Your next question

Every feature in Outlook Classic · All email CSS features · What real installs show

Get new email CSS fixes by email.

caniemail (MIT) via @emailens/engine 0.18.22 · tested upstream 15 Dec 2020 · data last changed 10 Nov 2026 · Outlook (New) cells are the engine's mapping