Gmail email CSS: what breaks, and what to write instead
152 of 300 features work in Gmail · 17 partial · 131 not supported. Of the 131 not supported, 5 work in at least 14 of the other 20 clients; the other 126 work in 13 or fewer.
Works 152 · Partial 17 · Not supported 131 · Untested 0 · of 300
Gmail Web · webmail · prefers-color-scheme: not supported
No signup · Five clients free, Outlook Classic included · All 21 with an account
The checker needs a computer screen.
Gmail is one of the five clients the checker runs with no account.
A free account opens all 21 clients and keeps your checks for 7 days. Create a free account →
@emailens/engine 0.18.22 · data last changed 10 Nov 2026
Where Gmail is the outlier
5 features work in at least 14 of the other 20 clients and are not supported here.
So an email that looks right in most clients can reach your reader in Gmail without them.
- box-shadow
Works in 14 of 21 · partial in 2 · not supported in 5
· not supported here - z-index
Works in 17 of 21 · not supported in 4
· not supported here - <rp>
Works in 15 of 21 · partial in 1 · not supported in 4 · 1 untested
· not supported here - <rt>
Works in 15 of 21 · partial in 1 · not supported in 4 · 1 untested
· not supported here - <ruby>
Works in 15 of 21 · partial in 1 · not supported in 4 · 1 untested
· not supported here
What to write instead
9 features Gmail does not fully support have a written fix. See them in the table ↓
visibility
The fix for Gmail
Use conditional comments or remove hidden content
<!-- For screen readers, use font-size: 0 trick -->
<div style="font-size: 0; max-height: 0; overflow: hidden;
mso-hide: all;" aria-hidden="true">
Preheader text
</div> Show the original
<div style="visibility: hidden;">
Hidden content for screen readers
</div> The checker needs a computer screen.
text-shadow
The fix for Gmail
Use font-weight or border-bottom as alternatives to text-shadow
.glow {
/* text-shadow is not supported in Gmail, Outlook, Yahoo.
Use font-weight or letter-spacing for emphasis instead. */
font-weight: bold;
letter-spacing: 0.5px;
} Show the original
.glow {
text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
} The checker needs a computer screen.
transform
The fix for Gmail
Pre-render transformed states as images or use table layout
The engine still flags this in the fix: An image points to an address no inbox can load (rotated-content.png), so Gmail shows a broken image instead.
<!-- Pre-render rotated content as an image -->
<img src="rotated-content.png" width="200" height="200"
alt="Rotated content"
style="display: block; border: 0;" /> Show the original
<div style="transform: rotate(45deg);">
Rotated content
</div> The checker needs a computer screen.
Paste your email and see what Gmail does to it.
No signup · Five clients free, Outlook Classic included · All 21 with an account
The checker needs a computer screen.
Dark mode in Gmail
-
Not supported @media prefers-color-scheme is not supported in Gmail.
Works in 9 of 21.
-
Not supported color-scheme is not supported in Gmail.
Works in 4 of 21.
-
Not supported meta-color-scheme is not supported in Gmail.
Works in 2 of 21.
How to target Gmail
Selectors that single out Gmail, from the community list the engine ships (howtotarget.email). Copy one and replace .your-class-name.
u + .body .your-class-name {
/* Replace this comment with your styles */
} Gmail changes the doctype to <u></u>.
Before you send to Gmail
- Keep the <style> block under 16KB and in the <head>: a block that breaks either rule loses every rule inside it, not just the overflow.
- Preview with images off. Readers who turn images off see only your alt text and background colours.
- Check the email against Gmail's dark interface. Gmail on the web does not change the message's own colours, so the edges of a white email meet a dark frame.
Your next question
Every feature in Gmail
HTML Elements · 18 of 48 not supported or partial here
- <abbr> Works Works in 14 of 21
- <acronym> Works Works in 13 of 21
- <address> Works Works in 20 of 21
- <audio> Not supported Works in 4 of 21
- <base> Buggy. Partial Works in 4 of 21
- <bdi> Not supported Works in 6 of 21
- <blockquote> Works Works in 19 of 21
- <body> Partial. Partial Works in 5 of 21
- <button type="reset"> Works Works in 10 of 21
- <button type="submit"> Works Works in 11 of 21
- <code> Works Works in 20 of 21
- <del> Works Works in 20 of 21
- <dfn> Works Works in 17 of 21
- <dialog> Not supported Works in 5 of 21
- <div> Works Works in 20 of 21
- <form> Works Works in 10 of 21
- <h1> Works Works in 20 of 21
- <hr> Works Works in 18 of 21
- <img> Works Works in 19 of 21
- <input type="checkbox"> Works Works in 16 of 21
- <input type="hidden"> Works Works in 16 of 21
- <input type="radio"> Works Works in 16 of 21
- <input type="reset"> Works Works in 15 of 21
- <input type="submit"> Works Works in 12 of 21
- <input type="text"> Works Works in 13 of 21
- <link> fix Not supported Works in 3 of 21
- <marquee> Not supported Works in 8 of 21
- <meter> Not supported Works in 11 of 21
- <object> Not supported Works in 1 of 21
- <p> Works Works in 20 of 21
- <picture>
<picture>and<source>tags are replaced by<u></u>tags. Not supported Works in 4 of 21 - <pre> Works Works in 20 of 21
- <progress> Not supported Works in 6 of 21
- <rp> Not supported Works in 15 of 21
- <rt> Not supported Works in 15 of 21
- <ruby> Not supported Works in 15 of 21
- <select> Works Works in 14 of 21
- <small> Works Works in 20 of 21
- <span> Works Works in 20 of 21
- <strike> Works Works in 17 of 21
- <strong> Works Works in 20 of 21
- <style> Partial. Partial Works in 16 of 21
- <svg> fix Not supported Works in 5 of 21
- <table> Works Works in 20 of 21
- <textarea> Works Works in 13 of 21
- <ul> Partial. Partial Works in 7 of 21
- <video> fix
<video>,<source>and<track>tags are replaced by<u></u>tags. Not supported Works in 3 of 21 - <wbr> Works Works in 16 of 21
HTML Attributes · 9 of 22 not supported or partial here
- [align] Works Works in 17 of 21
- [aria-describedby] Buggy. Not supported Works in 9 of 21
- [aria-hidden] Works Works in 13 of 21
- [aria-label] Works Works in 13 of 21
- [aria-labelledby] Buggy. Not supported Works in 7 of 21
- [aria-live] Works Works in 8 of 21
- [background] Works Works in 16 of 21
- [cellpadding] Works Works in 18 of 21
- [cellspacing] Works Works in 18 of 21
- [command] Not supported Works in 3 of 21
- [dir] Works Works in 19 of 21
- [height] Works Works in 18 of 21
- [hidden] Not supported Works in 5 of 21
- [lang] Works Works in 15 of 21
- [loading] Not supported Works in 4 of 21
- [popover] Not supported Works in 3 of 21
- [required] Not supported Works in 7 of 21
- [role] Works Works in 14 of 21
- [srcset] Not supported Works in 4 of 21
- [target] Not supported. Not supported Works in 0 of 21
- [valign] Works Works in 20 of 21
- [width] Works Works in 18 of 21
HTML & Email Structure · 2 of 8 not supported or partial here
- amp4email Works Works in 6 of 21
- anchor-links Works Works in 12 of 21
- doctype Works Works in 13 of 21
- html-comments Works Works in 18 of 21
- html5-semantics Partial. Partial Works in 6 of 21
- image-maps Works Works in 15 of 21
- mailto-links Works Works in 17 of 21
- meta-color-scheme Not supported Works in 2 of 21
CSS At-Rules · 9 of 10 not supported or partial here
- @font-face Not supported. Not supported Works in 6 of 21
- @import Not supported Works in 4 of 21
- @keyframes Not supported Works in 7 of 21
- @media Partial. Partial Works in 5 of 21
- @media device-pixel-ratio Not supported Works in 10 of 21
- @media hover Not supported Works in 9 of 21
- @media orientation Works Works in 11 of 21
- @media prefers-color-scheme Not supported Works in 9 of 21
- @media prefers-reduced-motion Not supported Works in 9 of 21
- @supports Not supported Works in 9 of 21
Pseudo-Elements · 6 of 6 not supported or partial here
- ::after Not supported Works in 6 of 21
- ::before Not supported Works in 6 of 21
- ::first-letter Not supported Works in 10 of 21
- ::first-line Not supported Works in 10 of 21
- ::marker Not supported Works in 10 of 21
- ::placeholder Not supported Works in 9 of 21
Pseudo-Classes & Selectors · 23 of 34 not supported or partial here
- :adjacent-sibling Works Works in 16 of 21
- :attribute-selector Partial. Partial Works in 6 of 21
- :chaining Works Works in 14 of 21
- :checked Not supported Works in 9 of 21
- :child-combinator Works Works in 16 of 21
- :class-selector Works Works in 17 of 21
- :descendant-combinator Works Works in 17 of 21
- :first-child Not supported Works in 12 of 21
- :first-of-type Not supported Works in 12 of 21
- :focus Not supported Works in 10 of 21
- :focus-visible Not supported Works in 6 of 21
- :focus-within Not supported Works in 6 of 21
- :general-sibling Works Works in 16 of 21
- :grouping Works Works in 17 of 21
- :has Not supported Works in 5 of 21
- :hover Works Works in 12 of 21
- :id-selector Works Works in 17 of 21
- :lang Not supported Works in 6 of 21
- :last-child Not supported Works in 12 of 21
- :last-of-type Not supported Works in 12 of 21
- :link Not supported Works in 13 of 21
- :not Not supported Works in 6 of 21
- :nth-child Not supported Works in 6 of 21
- :nth-last-child Not supported Works in 6 of 21
- :nth-of-type Not supported Works in 6 of 21
- :only-child Not supported Works in 12 of 21
- :only-of-type Not supported Works in 12 of 21
- :target Not supported Works in 7 of 21
- :type-selector Works Works in 17 of 21
- :universal-selector Works Works in 16 of 21
- :visited Not supported Works in 8 of 21
- pseudo-class-active Not supported Works in 8 of 21
- pseudo-class-default Not supported Works in 10 of 21
- pseudo-class-nth-last-of-type Not supported Works in 6 of 21
CSS Functions · 1 of 8 not supported or partial here
- calc Works Works in 8 of 21
- clamp Works Works in 6 of 21
- conic-gradient Not supported Works in 6 of 21
- fit-content Works Works in 11 of 21
- linear-gradient Works Works in 9 of 21
- max Works Works in 6 of 21
- min Works Works in 6 of 21
- radial-gradient Works Works in 10 of 21
CSS Properties · 80 of 164 not supported or partial here
- !important Partial. Partial Works in 11 of 21
- accent-color Not supported Works in 5 of 21
- align-items Not supported Works in 13 of 21
- animation fix Not supported Works in 5 of 21
- aspect-ratio Not supported Works in 5 of 21
- backdrop-filter Not supported Works in 6 of 21
- background Works Works in 16 of 21
- background-blend-mode Works Works in 13 of 21
- background-clip Works Works in 14 of 21
- background-color Works Works in 21 of 21
- background-image Works Works in 16 of 21
- background-origin Works Works in 14 of 21
- background-position Works Works in 20 of 21
- background-repeat Works Works in 20 of 21
- background-size Works Works in 17 of 21
- bimi Works Works in 9 of 21
- block-size Not supported Works in 7 of 21
- border Works Works in 20 of 21
- border-collapse Works Works in 19 of 21
- border-image Not supported Works in 7 of 21
- border-inline Not supported Works in 3 of 21
- border-inline-individual Not supported Works in 3 of 21
- border-inline-longhand Not supported Works in 4 of 21
- border-radius Works Works in 16 of 21
- border-radius-logical Not supported Works in 3 of 21
- border-spacing Works Works in 17 of 21
- bottom Not supported Works in 11 of 21
- box-shadow Not supported Works in 14 of 21
- box-sizing Works Works in 16 of 21
- caption-side Works Works in 20 of 21
- clear Works Works in 9 of 21
- clip-path Not supported Works in 8 of 21
- color Works Works in 21 of 21
- color-scheme Not supported Works in 4 of 21
- column-count Works Works in 16 of 21
- columns Works Works in 16 of 21
- css-comments Works Works in 14 of 21
- cursor Cursor property is removed. Not supported Works in 2 of 21
- custom-properties Partial. Not supported Works in 6 of 21
- direction Works Works in 21 of 21
- display Works Works in 13 of 21
- display:flex Works Works in 18 of 21
- display:grid Works Works in 18 of 21
- display:none Works Works in 20 of 21
- empty-cells Works Works in 14 of 21
- filter Not supported Works in 7 of 21
- flex Observed 2026-10-28 (Emailens probe, Gmail web (Chrome), real-device run 1isFNBBaOyEo): The
flexshorthand is dropped: an item atflex:0 0 34%lost its 34% and sized to its content. Not supported Works in 13 of 21 - flex-basis Observed 2026-10-28 (Emailens probe, Gmail web (Chrome), real-device run 1isFNBBaOyEo): Dropped, with flex-grow and flex-shrink beside it: the item sized to its content instead of 34%. Not supported Works in 13 of 21
- flex-direction Not supported Works in 12 of 21
- flex-wrap Not supported Works in 13 of 21
- float Works Works in 14 of 21
- font Works Works in 20 of 21
- font-family Works Works in 21 of 21
- font-kerning Works Works in 13 of 21
- font-size Works Works in 13 of 21
- font-size-adjust Works Works in 10 of 21
- font-stretch Works Works in 10 of 21
- font-weight Works Works in 16 of 21
- gap Partial. Partial Works in 7 of 21
- grid-template-columns Not supported Works in 7 of 21
- height Works Works in 16 of 21
- hyphenate-character Not supported Works in 4 of 21
- hyphenate-limit-chars Not supported Works in 1 of 21
- hyphens Not supported Works in 4 of 21
- inert Not supported Works in 3 of 21
- inline-size Not supported Works in 4 of 21
- inset Not supported Works in 3 of 21
- justify-content Not supported Works in 13 of 21
- left Not supported Works in 11 of 21
- letter-spacing Works Works in 20 of 21
- light-dark Not supported Works in 3 of 21
- line-height Works Works in 20 of 21
- list-style
list-style-imagevalues are not supported. Partial Works in 11 of 21 - list-style-image Not supported Works in 6 of 21
- list-style-position Works Works in 19 of 21
- list-style-type Works Works in 21 of 21
- margin Partial. Partial Works in 8 of 21
- margin-block-start-end Not supported Works in 4 of 21
- margin-inline-block Not supported Works in 6 of 21
- margin-inline-start-end Not supported Works in 4 of 21
- mask-image Not supported Works in 4 of 21
- max-block-size Not supported Works in 5 of 21
- max-height Works Works in 20 of 21
- max-inline-size Not supported Works in 4 of 21
- max-width Works Works in 20 of 21
- min-block-size Not supported Works in 4 of 21
- min-height Works Works in 19 of 21
- min-inline-size Not supported Works in 5 of 21
- min-width Works Works in 20 of 21
- mix-blend-mode Works Works in 13 of 21
- modern-color Using this syntax for an inline style will remove all inline styles applied to that element. Not supported Works in 4 of 21
- nesting Not supported Works in 2 of 21
- object-fit Works Works in 14 of 21
- object-position Works Works in 14 of 21
- opacity Works Works in 19 of 21
- orphans Webmail rendering depends on browser support Not supported Works in 10 of 21
- outline Works Works in 20 of 21
- outline-offset Not supported Works in 7 of 21
- overflow Partial. Partial Works in 4 of 21
- overflow-wrap fix Not supported Works in 2 of 21
- padding Works Works in 20 of 21
- padding-block-start-end Not supported Works in 4 of 21
- padding-inline-block Not supported Works in 3 of 21
- padding-inline-start-end Not supported Works in 4 of 21
- position fix Not supported Works in 2 of 21
- resize
resizeproperty is stripped from style tag Not supported Works in 1 of 21 - rgb Whitespace syntax is not supported (
rgb(0 128 0 / 1)). Partial Works in 12 of 21 - rgba Whitespace syntax is not supported (
rgb(0 128 0 / 1)). Partial Works in 12 of 21 - right Not supported Works in 11 of 21
- scroll-snap Not supported Works in 6 of 21
- shape-margin Not supported Works in 6 of 21
- shape-outside Not supported Works in 6 of 21
- system-ui Works Works in 12 of 21
- tab-size Not supported Works in 8 of 21
- table-layout Works Works in 16 of 21
- text-align Works Works in 13 of 21
- text-align-last Works Works in 7 of 21
- text-decoration Works Works in 14 of 21
- text-decoration-color Works Works in 17 of 21
- text-decoration-line Works Works in 16 of 21
- text-decoration-skip-ink Not supported Works in 7 of 21
- text-decoration-style Works Works in 16 of 21
- text-decoration-thickness Not supported Works in 7 of 21
- text-emphasis Works Works in 9 of 21
- text-emphasis-position Not supported Works in 4 of 21
- text-indent Partial. Partial Works in 13 of 21
- text-justify Partial. Partial Works in 0 of 21
- text-orientation Works Works in 13 of 21
- text-overflow Works Works in 13 of 21
- text-shadow fix Not supported Works in 12 of 21
- text-transform Works Works in 20 of 21
- text-underline-offset Not supported Works in 7 of 21
- text-underline-position Works Works in 8 of 21
- text-wrap Not supported Works in 4 of 21
- top Not supported Works in 11 of 21
- transform fix Not supported Works in 7 of 21
- transition Not supported Works in 4 of 21
- unit-ch Works Works in 15 of 21
- unit-cm Works Works in 20 of 21
- unit-em Works Works in 20 of 21
- unit-ex Works Works in 20 of 21
- unit-in Works Works in 20 of 21
- unit-initial Partial. Partial Works in 12 of 21
- unit-mm Works Works in 20 of 21
- unit-pc Works Works in 20 of 21
- unit-percent Works Works in 20 of 21
- unit-pt Works Works in 20 of 21
- unit-px Works Works in 20 of 21
- unit-rem Works Works in 15 of 21
- unit-vh Works Works in 17 of 21
- unit-vmax Works Works in 15 of 21
- unit-vmin Works Works in 15 of 21
- unit-vw Works Works in 18 of 21
- user-select Property is stripped from style tag Not supported Works in 3 of 21
- vertical-align Works Works in 21 of 21
- visibility fix Not supported Works in 13 of 21
- white-space Works Works in 15 of 21
- white-space-collapse Not supported Works in 4 of 21
- widows Webmail rendering depends on browser support Not supported Works in 10 of 21
- width Works Works in 20 of 21
- word-break Works Works in 4 of 21
- word-spacing Works Works in 14 of 21
- writing-mode Works Works in 13 of 21
- z-index Not supported Works in 17 of 21
How Gmail renders email
Gmail on the web renders a sanitised copy of your HTML. It keeps a <style> block in the <head>, up to 16KB, and supports media queries other than height-based ones, but <link> stylesheets, @font-face and positioning are not supported, and it rewrites every class name. Inline styles remain the safest place for anything critical: a <style> block in the <body> is discarded, and past 16KB Gmail keeps the rules before the limit and drops the rest.
- <style> blocks
- Kept only in the <head> and only up to 16KB. A block in the <body>, or one over the limit, is removed, and every rule in it goes with it. External stylesheets in <link> are always removed.
- @font-face
- Not supported. Gmail shows Roboto and Google Sans only because its own interface loads them, so a font stack should end in a system font.
- position
- Not supported. Overlays and absolutely positioned badges fall back into normal flow, so build them with table cells or background images.
- prefers-color-scheme
- Not supported, so dark-mode styles written in a media query never apply in Gmail.
- Gmail rewrites class names with a per-message prefix and rewrites the selectors in your <style> block to match, so class-based styling keeps working. What breaks is anything that depends on the original name from outside, such as a selector in an external stylesheet.
- Flexbox and grid are supported here, which makes Gmail on the web more capable than the Gmail apps reading non-Google accounts and far more capable than Outlook Classic. A layout that needs to reach both should still be built on tables.
- Media queries work, except height-based ones, which lets one email adapt between Gmail's desktop and mobile layouts.