: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
| Client | Category | Engine | Support |
|---|---|---|---|
| Gmail | webmail | Gmail Web | PartialSee caveat 1 |
| Gmail Android | mobile | Gmail Mobile | PartialSee caveat 2 |
| Gmail iOS | mobile | Gmail Mobile | PartialSee caveat 2 |
| Outlook 365 | webmail | Outlook Web | PartialSee caveat 3 |
| Outlook (New) | desktop | Outlook Web | Unsupported |
| Outlook Classic | desktop | Microsoft Word | Unsupported |
| Outlook iOS | mobile | Outlook Mobile | PartialSee caveat 4 |
| Outlook Android | mobile | Outlook Mobile | PartialSee caveat 4 |
| Outlook for Mac | desktop | WebKit | Supported |
| Apple Mail | desktop | WebKit | Supported |
| Apple Mail iOS | mobile | WebKit | Supported |
| Yahoo Mail | webmail | Yahoo | PartialSee caveat 5 |
| Yahoo Mail Android | mobile | Yahoo | PartialSee caveat 5 |
| Yahoo Mail iOS | mobile | Yahoo | PartialSee caveat 5 |
| Samsung Mail | mobile | Samsung | Supported |
| Thunderbird | desktop | Gecko | Supported |
| HEY Mail | webmail | WebKit | Supported |
| Proton Mail | webmail | Proton | Unsupported |
| AOL Mail | webmail | AOL | PartialSee caveat 5 |
| Fastmail | webmail | Fastmail | Supported |
| Superhuman | desktop | Blink | Unknown |
Documented caveats (5)
- 1.Gmail: Partial. Only supports
[attr~=value]syntax. Onlyclassas an attribute name is known to be supported. - 2.Gmail Android, Gmail iOS: Partial. Only supports
[attr~=value]syntax. Onlyclassas an attribute name is known to be supported. Partial. Doesn't work with non Google accounts. - 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. Aclass="test"in the HTML is prefixedclass="x_test", but an attribute selector stays unprefixed[class="test"]. - 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.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.
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.