:attribute-selector
selector or pseudo-class · 5 supported, 7 partial, 2 unsupported across 15 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 |
| Apple Mail | desktop | WebKit | Supported |
| Apple Mail iOS | mobile | WebKit | Supported |
| Yahoo Mail | webmail | Yahoo | Partial |
| Samsung Mail | mobile | Samsung | Supported |
| Thunderbird | desktop | Gecko | Supported |
| HEY Mail | webmail | WebKit | Supported |
| Superhuman | desktop | Blink | Unknown |
Client-by-client behaviour for :attribute-selector
Fully supports :attribute-selector (5): Apple Mail, Apple Mail iOS, Samsung Mail, Thunderbird, HEY Mail.
Partial support (7): Gmail, Gmail Android, Gmail iOS, Outlook 365, Outlook iOS, Outlook Android, Yahoo 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 (2): Outlook (New), Outlook Classic. 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.
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.
Related Features
Test your email across all 15 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.