Skip to main content
CSS Functions

fit-content

CSS function · 7 supported, 3 partial, 4 unsupported across 15 clients

fit-content() returns a size that grows to its content but caps at a given maximum. It is used as both a sizing keyword and a function in modern CSS, and email support is limited — Apple Mail honors it, while Outlook and Gmail ignore it. For email, traditional table cell widths remain the most reliable sizing mechanism.

Client Support

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

Client-by-client behaviour for fit-content

Fully supports fit-content (7): Gmail, Gmail Android, Outlook 365, Apple Mail, Apple Mail iOS, Thunderbird, HEY Mail.

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

No support (4): Outlook (New), Outlook Classic, Yahoo Mail, Samsung Mail. Plan fallbacks for these clients before relying on fit-content in production sends.

Behaviour unverified in: Superhuman.

When to use fit-content in email

  • Sizing a button to its label without a fixed width.
  • Fluid card sizing in modern-client-only layouts.
  • Constraining a content block to its natural width while capping at a max.

Rendering behaviour and edge cases

  • Outlook on Windows ignores fit-content() entirely.
  • Apple Mail supports it in recent versions.
  • Behavior on Gmail Web varies between Chromium versions.

Recommended fallback strategy

Use fit-content() only as progressive enhancement. Provide a fixed pixel width or a width attribute on table cells as the baseline so non-supporting clients still receive a sensible size.

Fixes & Workarounds

Outlook (New)

Unsupported

"fit-content" is not supported in this email client.

Outlook Classic

Unsupported

"fit-content" is not supported in this email client.

Yahoo Mail

Unsupported

"fit-content" is not supported in this email client.

Samsung Mail

Unsupported

"fit-content" is not supported in this email client.

Gmail iOS

Partial

"fit-content" is not supported in this email client.

Outlook iOS

Partial

"fit-content" is not supported in this email client.

Outlook Android

Partial

"fit-content" 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.