Skip to main content
Emailens
Pseudo-Classes & Selectors

:attribute-selector

selector or pseudo-class · 7 supported, 10 partial, 3 unsupported across 21 clients

As of Sep 2, 2026, :attribute-selector fails or degrades in 14 of 21 email clients, treat it as progressive enhancement, never structure.

  • 2/7 webmail, 3/6 desktop, 2/8 mobile clients support :attribute-selector fully.
  • Unsupported in Outlook (New), Outlook Classic, Proton Mail.
  • Partial in Gmail, Gmail Android, Gmail iOS, Outlook 365 and 6 more, behavior differs from browsers, test before relying on it.
  • Outlook Classic (Word engine, supported to at least 2029) does not fully support :attribute-selector, and its replacement changes little here; see the deprecation diff.
  • Across all clients, only 6 of 298 tracked HTML/CSS features render identically everywhere.

Source: caniemail.com (MIT), via the Emailens engine. Last tested upstream Dec 15, 2020, synced by Emailens Sep 2, 2026.

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 on Windows.

Client Support

ClientCategoryEngineSupport
GmailwebmailGmail WebPartialSee caveat 1
Gmail AndroidmobileGmail MobilePartialSee caveat 2
Gmail iOSmobileGmail MobilePartialSee caveat 2
Outlook 365webmailOutlook WebPartialSee caveat 3
Outlook (New)desktopOutlook WebUnsupported
Outlook ClassicdesktopMicrosoft WordUnsupported
Outlook iOSmobileOutlook MobilePartialSee caveat 4
Outlook AndroidmobileOutlook MobilePartialSee caveat 4
Outlook for MacdesktopWebKitSupported
Apple MaildesktopWebKitSupported
Apple Mail iOSmobileWebKitSupported
Yahoo MailwebmailYahooPartialSee caveat 5
Yahoo Mail AndroidmobileYahooPartialSee caveat 5
Yahoo Mail iOSmobileYahooPartialSee caveat 5
Samsung MailmobileSamsungSupported
ThunderbirddesktopGeckoSupported
HEY MailwebmailWebKitSupported
Proton MailwebmailProtonUnsupported
AOL MailwebmailAOLPartialSee caveat 5
FastmailwebmailFastmailSupported
SuperhumandesktopBlinkUnknown

Documented 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: 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 recorded by caniemail.com (MIT) and carried verbatim, one entry per wording rather than per client.

Client-by-client behaviour for :attribute-selector

Fully supports :attribute-selector (7): Outlook for Mac, Apple Mail, Apple Mail iOS, Samsung Mail, Thunderbird, HEY Mail, Fastmail.

Partial support (10): Gmail, Gmail Android, Gmail iOS, Outlook 365, Outlook iOS, Outlook Android, Yahoo Mail, Yahoo Mail Android, Yahoo Mail iOS, AOL Mail. Expect rendering quirks unique to each engine. Partial support typically means a subset of values, an ignored shorthand, or sanitizer-specific rewrites.

No support (3): Outlook (New), Outlook Classic, Proton Mail. Plan fallbacks for these clients before relying on :attribute-selector in production sends.

Behaviour unverified in: Superhuman.

When to use :attribute-selector in email

  • Targeting form inputs by type in AMP for Email contexts.
  • Selecting elements by data-* attributes for dark-mode style overrides.
  • Cross-cutting styles based on aria-* attributes for accessibility consistency.

Rendering behaviour and edge cases

  • 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.

Recommended fallback strategy

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.

Fixes & Workarounds

Outlook (New)

Unsupported

":attribute-selector" is not supported in this email client.

Outlook Classic

Unsupported

":attribute-selector" is not supported in this email client.

Proton Mail

Unsupported

":attribute-selector" is not supported in this email client.

Gmail

Partial

":attribute-selector" is not supported in this email client.

Gmail Android

Partial

":attribute-selector" is not supported in this email client.

Gmail iOS

Partial

":attribute-selector" is not supported in this email client.

Outlook 365

Partial

":attribute-selector" is not supported in this email client.

Outlook iOS

Partial

":attribute-selector" is not supported in this email client.

Outlook Android

Partial

":attribute-selector" is not supported in this email client.

Yahoo Mail

Partial

":attribute-selector" is not supported in this email client.

Yahoo Mail Android

Partial

":attribute-selector" is not supported in this email client.

Yahoo Mail iOS

Partial

":attribute-selector" is not supported in this email client.

AOL Mail

Partial

":attribute-selector" is not supported in this email client.

Related Features

Check your own HTML for :attribute-selector

Paste your own, or run the sample below. Analyzed in this page, with no signup and nothing stored.

Zero-Friction Engine Preview

Test your :attribute-selector layout across 21 email clients

Preview rendering, catch CSS issues, and see how :attribute-selector displays across Outlook, Gmail, and Apple Mail. Free, no account needed.

Instant live preview · No signup required · 21 email engines

Last tested upstream: · Last synced by Emailens:

caniemail.com (MIT) records Dec 15, 2020 as the last time :attribute-selector was tested in a real client, 5 years before this sync. Syncing copies that result forward, it does not re-test it. Carried in @emailens/engine data v0.12.2.