Skip to main content
Pseudo-Classes & Selectors

: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

ClientCategoryEngineSupport
GmailwebmailGmail WebPartial
Gmail AndroidmobileGmail MobilePartial
Gmail iOSmobileGmail MobilePartial
Outlook 365webmailOutlook WebPartial
Outlook (New)desktopOutlook WebUnsupported
Outlook ClassicdesktopMicrosoft WordUnsupported
Outlook iOSmobileOutlook MobilePartial
Outlook AndroidmobileOutlook MobilePartial
Apple MaildesktopWebKitSupported
Apple Mail iOSmobileWebKitSupported
Yahoo MailwebmailYahooPartial
Samsung MailmobileSamsungSupported
ThunderbirddesktopGeckoSupported
HEY MailwebmailWebKitSupported
SuperhumandesktopBlinkUnknown

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 Free

Support data last updated Apr 27, 2026 · synced from caniemail.com via @emailens/engine.