:attribute-selector
selector or pseudo-class · 7 supported, 10 partial, 3 unsupported across 21 clients
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 | Partial |
| Gmail Android | mobile | Gmail Mobile | Partial |
| Gmail iOS | mobile | Gmail Mobile | Partial |
| Outlook 365 | webmail | Outlook Web | Partial |
| Outlook (New) | desktop | Outlook Web | Unsupported |
| Outlook Classic | desktop | Microsoft Word | Unsupported |
| Outlook iOS | mobile | Outlook Mobile | Partial |
| Outlook Android | mobile | Outlook Mobile | Partial |
| Outlook for Mac | desktop | WebKit | Supported |
| Apple Mail | desktop | WebKit | Supported |
| Apple Mail iOS | mobile | WebKit | Supported |
| Yahoo Mail | webmail | Yahoo | Partial |
| Yahoo Mail Android | mobile | Yahoo | Partial |
| Yahoo Mail iOS | mobile | Yahoo | Partial |
| Samsung Mail | mobile | Samsung | Supported |
| Thunderbird | desktop | Gecko | Supported |
| HEY Mail | webmail | WebKit | Supported |
| Proton Mail | webmail | Proton | Unsupported |
| AOL Mail | webmail | AOL | Partial |
| Fastmail | webmail | Fastmail | Supported |
| Superhuman | desktop | Blink | Unknown |
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
Test your email across all 21 clients
Preview rendering, catch CSS issues, and get actionable fixes. Free.
Try Emailens FreeSupport data last updated Apr 27, 2026 · synced from caniemail.com via @emailens/engine.