Media queries in email work in Apple Mail, iOS Mail, Gmail with a Google account, Yahoo Mail, Samsung Email and most Outlook apps, but not in classic Outlook for Windows, and not in the Gmail apps when the reader has signed in with a non-Google account such as Outlook.com or Yahoo. So a responsive email cannot rely on them: build a fluid hybrid layout whose columns stack on their own, give classic Outlook fixed widths in ghost tables, and use media queries only to improve the result where they are read.
The complete email below proves the point: with its <style> block deleted, it still stacks to one column at 375 pixels, as the second figure shows, and the media query only tidies what is already working. The figures are that code, drawn by a browser, and the HTML email developer’s guide shows where this layout fits among the other parts of an email.
Why media queries are not enough on their own
A media query is a block of CSS that applies only when a condition is true, such as the screen being 620 pixels wide or less. On the web, every browser reads them. In email, the CSS has to survive the mail client first, and there are three ways it does not.
Classic Outlook for Windows ignores them. Outlook 2007 to 2019 for Windows draw email with Microsoft Word’s engine, and caniemail records @media as not supported in all of them. Microsoft’s own list of what that engine does not support also includes max-width, min-width and float, which is why a layout built only from those falls apart there. Email CSS support lists the rest by client.
Some Gmail readers never get your <style> block. Google’s CSS page says Gmail supports <style> blocks and “queries against screen width, orientation, and resolution”. Caniemail adds the limits. In the Gmail apps for iOS and Android, <style> and media queries are “not supported with non Google accounts”, so someone who reads an Outlook.com or Yahoo address in the Gmail app gets your inline styles only. Gmail’s mobile web version does not support <style> at all. And on the desktop, Gmail keeps a <style> block only up to 16 KB and ignores one placed in the <body>.
Other clients support only part of the syntax. Caniemail lists Yahoo Mail and AOL as supporting only screen, min-width, max-width, min-height and max-height queries, Outlook.com and Outlook for Mac as removing nested media queries, Gmail as not supporting height-based queries, and Samsung Email as not running them for Hotmail and Outlook accounts.
So the rule every reliable responsive email follows is: the layout must already work with no media query at all. The media query is the improvement, not the foundation.
Three ways to build a responsive email
| Approach | How it adapts | Needs media queries | Classic Outlook | Gmail app, non-Google account |
|---|---|---|---|---|
| Fluid | Widths in percentages, one column | No | Needs a fixed-width ghost table | Works |
| Responsive (media query only) | Fixed desktop layout, a media query rewrites it for phones | Yes | Shows the desktop layout | Shows the desktop layout, squeezed |
| Fluid hybrid (spongy) | max-width columns that wrap on narrow screens, plus ghost tables for Outlook |
No, optional | Fixed columns from ghost tables | Columns stack |
Email developers also call the third approach spongy. Nicole Merlin’s tutorial on Envato Tuts+ explains the fluid hybrid name: “The fluid part refers to the fact that we use lots of percentages and elements that can move and expand to fit the space they are given. The hybrid part is because we also use max-width to constrain these free-flowing elements”. The open-source Cerberus patterns on GitHub ship all three as separate starting files, and describe the hybrid one as reconfiguring the layout “for different screen sizes for email clients regardless of media query support”.
For anything with more than one column, use fluid hybrid, and add a media query on top. That is what the rest of this page builds.
The complete responsive email
Here is a full email: a hero image, a heading and text, two columns of products and a row of three smaller ones. It is 600 pixels wide on a desktop, stacks to one column on a phone, and holds a fixed two- and three-column layout in classic Outlook.
<!DOCTYPE html>
<html lang="en" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="x-apple-disable-message-reformatting" content="true">
<title>New this week</title>
<!--[if mso]>
<noscript><xml><o:OfficeDocumentSettings><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml></noscript>
<![endif]-->
<!--[if mso]><style>body, table, td, th, div, p, a, li, span, h1, h2, h3, h4, h5, h6 { font-family: Arial, Helvetica, sans-serif !important; }</style><![endif]-->
<style>
table, td { border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; }
img { border: 0; display: block; height: auto; outline: none; text-decoration: none; }
@media screen and (max-width: 620px) {
.px { padding-left: 20px !important; padding-right: 20px !important; }
.h1 { font-size: 26px !important; line-height: 32px !important; }
.col { max-width: 100% !important; }
.col img { width: 100% !important; max-width: 100% !important; }
.col-pad { padding-left: 0 !important; padding-right: 0 !important; }
}
</style>
</head>
<body style="margin:0; padding:0; background-color:#eef2f7;">
<div role="article" aria-roledescription="email" lang="en" style="background-color:#eef2f7;">
<!--[if mso]><table role="presentation" align="center" width="600" cellpadding="0" cellspacing="0" border="0"><tr><td width="600"><![endif]-->
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="width:100%; max-width:600px; margin:0 auto; background-color:#ffffff;">
<tr>
<td>
<img src="https://example.com/hero-1200x500.jpg" width="600" height="250" alt="The winter range, new this week" style="display:block; width:100%; max-width:600px; height:auto; background-color:#1b2a4a;">
</td>
</tr>
<tr>
<td class="px" style="padding:32px 30px 8px; font-family:Arial, Helvetica, sans-serif; color:#1b2a4a;">
<h1 class="h1" style="margin:0 0 12px; font-size:32px; line-height:38px; font-weight:bold;">New this week</h1>
<p style="margin:0; font-size:16px; line-height:26px; color:#3d4a63;">Two columns on a desktop, one on a phone. The columns below stack on their own, and the media query widens them where it is supported.</p>
</td>
</tr>
<tr>
<td class="px" style="padding:16px 30px 8px; font-size:0; text-align:center;">
<!--[if mso]><table role="presentation" width="540" cellpadding="0" cellspacing="0" border="0"><tr><td width="270" valign="top"><![endif]-->
<div class="col" style="display:inline-block; width:100%; max-width:270px; vertical-align:top; text-align:left;">
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr><td class="col-pad" style="padding:0 10px 20px; font-family:Arial, Helvetica, sans-serif; font-size:16px; line-height:24px; color:#3d4a63;">
<img src="https://example.com/coat-500x320.jpg" width="250" height="160" alt="Wool coat in navy" style="display:block; width:100%; max-width:250px; height:auto; margin:0 0 12px;">
<strong style="color:#1b2a4a;">Wool coat</strong><br>Warm, light and water resistant.
</td></tr>
</table>
</div>
<!--[if mso]></td><td width="270" valign="top"><![endif]-->
<div class="col" style="display:inline-block; width:100%; max-width:270px; vertical-align:top; text-align:left;">
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr><td class="col-pad" style="padding:0 10px 20px; font-family:Arial, Helvetica, sans-serif; font-size:16px; line-height:24px; color:#3d4a63;">
<img src="https://example.com/scarf-500x320.jpg" width="250" height="160" alt="Knitted scarf in orange" style="display:block; width:100%; max-width:250px; height:auto; margin:0 0 12px;">
<strong style="color:#1b2a4a;">Knitted scarf</strong><br>Merino, in six colours.
</td></tr>
</table>
</div>
<!--[if mso]></td></tr></table><![endif]-->
</td>
</tr>
<tr>
<td class="px" style="padding:0 30px 24px; font-size:0; text-align:center;">
<!--[if mso]><table role="presentation" width="540" cellpadding="0" cellspacing="0" border="0"><tr><td width="180" valign="top"><![endif]-->
<div class="col" style="display:inline-block; width:100%; max-width:180px; vertical-align:top; text-align:left;">
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr><td class="col-pad" style="padding:0 10px 16px; font-family:Arial, Helvetica, sans-serif; font-size:14px; line-height:20px; color:#3d4a63;">
<img src="https://example.com/gloves-320.jpg" width="160" height="160" alt="Leather gloves" style="display:block; width:100%; max-width:160px; height:auto; margin:0 0 8px;">
<strong style="color:#1b2a4a;">Gloves</strong>
</td></tr>
</table>
</div>
<!--[if mso]></td><td width="180" valign="top"><![endif]-->
<!-- second and third 180 pixel columns: same as the first, with their own image and text -->
<!--[if mso]></td></tr></table><![endif]-->
</td>
</tr>
</table>
<!--[if mso]></td></tr></table><![endif]-->
</div>
</body>
</html>
The three-column row is shortened to one column in the listing to save space; the other two are copies of the first with the <!--[if mso]></td><td width="180" valign="top"><![endif]--> separator between them, as in the two-column row. The figures below are drawn from the full file.
How the code works, part by part
The head
<meta name="viewport" content="width=device-width, initial-scale=1">tells phone mail apps that show the email in a browser view to use the screen’s width rather than zooming out a desktop-width page. MDN documentswidth=device-widthas setting the viewport to the device’s width.x-apple-disable-message-reformattingturns off a fix iOS Mail applies to emails it thinks are not responsive. Good Email Code explains that without it, a responsive email could be shown at half the width of the screen and zoomed out; with it, the layout is left to your code. Apple does not document the tag.- The
[if mso]block sets 96 pixels per inch for classic Outlook. Caniemail records that sizes set inwidthattributes do not scale in Outlook’s 120 dpi mode; this setting keeps tables and images at the sizes you wrote on Windows machines with display scaling. The HTML email template explains the block line by line. - The Outlook font rule in the second
[if mso]block sets Arial on every text element for classic Outlook only, so a font it cannot resolve never falls back to Times New Roman. This page’s own stack is already Arial, but the rule costs nothing and protects later edits that add a web font. - The resets:
border-collapseremoves cell spacing, and the twomso-tableproperties zero the side spacing classic Outlook adds beside tables floated withalign="left"oralign="right"; they do nothing to centred tables, as Good Email Code’s MSO styles page explains. Theimgrule removes borders and the gap under inline images. - The media query follows. It is in the
<head>, never the<body>, because Gmail ignores<style>in the body. Each rule ends in!importantbecause it has to beat an inline style, and caniemail notes that Gmail supports!importantonly in lowercase, so write it exactly as shown. There are no CSS comments inside it: caniemail recorded Yahoo ignoring the rule after a comment in 2019, and comments still cost bytes against Gmail’s 16 KB limit.
The container and its ghost table
<!--[if mso]><table role="presentation" align="center" width="600" cellpadding="0" cellspacing="0" border="0"><tr><td width="600"><![endif]-->
<table role="presentation" width="100%" style="width:100%; max-width:600px; margin:0 auto;">
...
</table>
<!--[if mso]></td></tr></table><![endif]-->
The inner table is fluid: as wide as the screen, up to 600 pixels. Every client except classic Outlook respects that. Caniemail shows max-width unsupported in Outlook 2007 to 2016 for Windows and supported only on table elements in Outlook 2019, so on older versions the email would stretch across the whole reading pane.
The ghost table fixes that. <!--[if mso]> opens a conditional comment that only Microsoft Office’s Word engine reads; every other client sees an ordinary HTML comment and skips it. Inside it is a plain 600 pixel table, so Outlook gets a fixed width while everyone else gets the fluid one. <![endif]--> closes it, and the second pair of comments closes the table after the content. Good Email Code calls these ghost tables and uses the same structure for its container.
Columns that stack without a media query
<td style="padding:16px 30px 8px; font-size:0; text-align:center;">
<!--[if mso]><table role="presentation" width="540"><tr><td width="270" valign="top"><![endif]-->
<div class="col" style="display:inline-block; width:100%; max-width:270px; vertical-align:top; text-align:left;">
first column
</div>
<!--[if mso]></td><td width="270" valign="top"><![endif]-->
<div class="col" style="display:inline-block; width:100%; max-width:270px; vertical-align:top; text-align:left;">
second column
</div>
<!--[if mso]></td></tr></table><![endif]-->
</td>
This is the hybrid part, and it is the core of every responsive email:
- The cell has 30 pixels of padding on each side, leaving 540 pixels for columns inside a 600 pixel email.
- Each column is an inline-block
<div>that iswidth:100%but never more thanmax-width:270px. Two fit side by side in 540 pixels. Three 180 pixel columns fit the same way. - On a narrower screen, there is no room for two, so the second column wraps under the first, exactly as words wrap in a paragraph. No media query is involved, so this works in the Gmail app with a non-Google account, in Gmail’s mobile web version, and anywhere else the
<style>block is dropped. font-size:0on the cell removes the gap the browser draws for the line break between two inline-block elements. Without it, two 270 pixel columns plus a space of a few pixels need more than 540 pixels, and the second column always wraps. Good Email Code warns that fixes for inline-block spacing “are delicate”, so this code resets the font size on each column’s own cell.text-align:centeron the cell centres a stacked column;text-align:lefton each column puts its own text back.vertical-align:topkeeps columns of different heights aligned at the top.
The Outlook part is the ghost table again: a 540 pixel table with one 270 pixel cell per column, opened before the first <div>, split between columns with </td><td>, and closed after the last. Classic Outlook cannot do inline-block layout (caniemail lists display as supported there only for display:none), so it draws the table and ignores the divs’ layout. The columns never stack in classic Outlook, which is fine: it runs on desktop computers.
What the media query adds
Stacked columns at their desktop width look stranded on a phone, as the figure above shows. Where media queries work, five rules tidy that up:
@media screen and (max-width: 620px) {
.px { padding-left: 20px !important; padding-right: 20px !important; }
.h1 { font-size: 26px !important; line-height: 32px !important; }
.col { max-width: 100% !important; }
.col img { width: 100% !important; max-width: 100% !important; }
.col-pad { padding-left: 0 !important; padding-right: 0 !important; }
}
max-width: 620pxis the 600 pixel container plus 10 pixels either side. Below that width the email is already touching the screen edges, so that is the point to switch. Choose your own breakpoint from your container width, not from a list of device sizes..pxshrinks the side padding from 30 to 20 pixels, giving text more room..h1reduces the heading so it wraps onto fewer lines..colremoves the 270 and 180 pixel caps, so each stacked column fills the width..col imglets the images follow. Without this rule they would stay at theirmax-width..col-padremoves the 10 pixel gutters between columns, which are not needed once they are stacked.
Use max-width queries, as here, rather than max-device-width. Google’s list of supported queries includes both, but the rest of the clients in caniemail’s tests, Yahoo included, support max-width, and it is the one that responds to a narrow window on a desktop as well as a phone.
Media query support by email client
| Client | Media queries | Limits recorded by caniemail | What a reader sees with this page’s code |
|---|---|---|---|
| Apple Mail (macOS) and iOS Mail | Yes | None | Hybrid layout plus media query |
| Gmail on the web | Partial | No height queries; <style> in head only, up to 16 KB |
Hybrid layout plus media query |
| Gmail apps, Google account | Partial | No height queries | Hybrid layout plus media query |
| Gmail apps, non-Google account | No | <style> and media queries not supported |
Hybrid stacking only |
| Gmail mobile web | No | <style> not supported |
Hybrid stacking only |
| Classic Outlook for Windows (2007 to 2019 in caniemail’s tests; 2021, 2024 and Microsoft 365 use the same Word engine) | No | max-width only on tables in 2019 |
Fixed columns from ghost tables |
| New Outlook for Windows | Not in caniemail | Microsoft says it is based on WebView2, with the Outlook on the web experience | Treat as Outlook on the web; test it |
| Outlook.com and Outlook on the web | Partial | Nested media queries removed | Hybrid layout plus media query |
| Outlook for Mac, iOS and Android | Partial | No nested media queries | Hybrid layout plus media query |
| Yahoo Mail and AOL | Partial | Only screen, min-width, max-width, min-height, max-height |
Hybrid layout plus media query |
| Samsung Email | Partial | Not with Hotmail or Outlook accounts | Media query for most accounts |
| Thunderbird (102) | No | Supported in version 60, not in 78 or 102 (caniemail’s result; test it if you have Thunderbird readers) | Hybrid stacking only |
Sources: caniemail’s @media, <style> and max-width pages (the @media data was last tested on 13 December 2023), Google’s Gmail CSS page, and Microsoft’s overview of the new Outlook for Windows. Caniemail is the most complete public record, but its rows have test dates, and clients change; the email testing checklist covers checking your own sends.
Responsive images
An image in a responsive email needs three things, and each is for a different client:
<img src="https://example.com/hero-1200x500.jpg" width="600" height="250" alt="The winter range, new this week" style="display:block; width:100%; max-width:600px; height:auto;">
width="600" height="250"attributes in pixels are what classic Outlook uses. Caniemail records that in Outlook for Windows a percentage width on an<img>is calculated from the image file’s own width, not from the column, sowidth="100%"on a 1,200 pixel file gives you a 1,200 pixel image. Always write the shown size in pixels in the attribute.width:100%; max-width:600px; height:autoinline is what everyone else uses: the image fills its column, never grows past 600 pixels, and keeps its proportions as it shrinks. Microsoft’s list confirms the Word engine ignoresmax-width, so this style cannot confuse Outlook.display:blockremoves the few pixels of space some clients add below an inline image.
Save the file at twice the shown size, here 1,200 by 500, so it stays sharp on high-density phone screens. Email image size has the width for every slot, email width covers going wider than 600, and retina countdown timers shows what doubling does to file weight.
Do not depend on srcset or <picture> to serve phone-sized images. Caniemail shows srcset supported in Apple Mail, Samsung Email and Thunderbird, and not in Gmail, Outlook or Yahoo, and it records that Gmail replaces <picture> and <source> tags with <u> tags. One 2x file scaled with the code above works everywhere.
Swapping an image on phones
Sometimes a wide desktop banner is unreadable on a phone and you want a different crop. Hide the mobile image by default, and show it, while hiding the desktop one, in the media query:
<style>
@media screen and (max-width: 620px) {
.desktop-only { display: none !important; }
.mobile-only { display: block !important; max-height: none !important; overflow: visible !important; }
}
</style>
<div class="desktop-only">
<img src="https://example.com/banner-wide-1200x300.jpg" width="600" height="150" alt="Winter sale, up to 40 percent off" style="display:block; width:100%; max-width:600px; height:auto;">
</div>
<!--[if !mso]><!-->
<div class="mobile-only" style="display:none; max-height:0; overflow:hidden;">
<img src="https://example.com/banner-square-750x750.jpg" width="375" height="375" alt="Winter sale, up to 40 percent off" style="display:block; width:100%; height:auto;">
</div>
<!--<![endif]-->
The mobile version is wrapped in <!--[if !mso]><!--> so classic Outlook never sees it, and it is hidden with an inline display:none plus max-height:0; overflow:hidden, so any client that drops the <style> block simply shows the desktop banner. Caniemail notes classic Outlook supports display:none but not on <img> elements, which is why the hiding is on a wrapping <div>. Both images have the same alt text, because only one is ever visible. Keep swaps like this rare: each one adds an image the reader may download and never see.
Reverse stacking: image on the right, still first on mobile
A common design alternates image-left and image-right rows. On a phone, columns stack in code order, so the image-right row would show its text first. To keep the image first in the code and still draw it on the right on a desktop, set dir="rtl" on the row and dir="ltr" on each column:
<td dir="rtl" style="padding:4px 20px 24px; font-size:0; text-align:center;">
<!--[if mso]><table role="presentation" width="560" dir="rtl"><tr><td width="280" valign="middle" dir="ltr"><![endif]-->
<div dir="ltr" style="display:inline-block; width:100%; max-width:280px; vertical-align:middle;">
image
</div>
<!--[if mso]></td><td width="280" valign="middle" dir="ltr"><![endif]-->
<div dir="ltr" style="display:inline-block; width:100%; max-width:280px; vertical-align:middle; text-align:left;">
text
</div>
<!--[if mso]></td></tr></table><![endif]-->
</td>
With dir="rtl", inline-block columns line up from right to left, so the first one in the code lands on the right. When the screen is too narrow for both, the first column still comes first, on top. The dir="ltr" on each column puts the text inside back to left-to-right. Caniemail lists the dir attribute as supported in Gmail, Apple Mail, Yahoo, Samsung Email and the Outlook apps, with a recorded bug in classic Outlook on links, so keep links inside the columns styled and tested.
There is one trade-off, which Good Email Code points out for every reordering trick: screen readers and keyboard users follow the code order, not the visual order. Here that is image then text in both rows, which reads naturally.
Frameworks write this code for you
If you build emails often, a framework produces the hybrid columns, ghost tables and media query from shorter markup. MJML’s documentation describes mj-column as columns “which stack when viewed on a mobile device”, mj-group as the way to keep columns side by side on mobile, and mj-breakpoint as the setting that controls the width where the layout switches. The MJML tutorial builds a responsive email with it, and MJML vs Maizzle vs Foundation for Emails compares the main options. It still pays to know the hand-written version above: when a framework’s output breaks in one client, this is the code you will be reading.
Common problems and their fixes
- Two 50 percent or 270 pixel columns never sit side by side. The whitespace between the two
<div>tags is adding a gap. Setfont-size:0on the parent cell, or remove the line break between</div>and<div>. - Columns stack in Gmail on a desktop. Usually the columns plus their padding add up to more than the space. Check the arithmetic: column
max-widthtimes the number of columns must not exceed the cell’s width inside its padding. - The email is full width in Outlook. The ghost table is missing, or a sending platform’s editor removed the conditional comments. Look at the sent email’s source, not the editor.
- The media query works in Apple Mail but not in Gmail. The
<style>block may be over 16 KB, inside the<body>, or contain a syntax error. Move it into the<head>and keep it short. - Images overflow the screen on a phone. The image has a fixed
widthin its inline style. Usewidth:100%; max-width:...px; height:autoinline, and keep the pixel size in the attribute. - Text is tiny on iPhone or suddenly large. iOS can resize small text;
-webkit-text-size-adjust:100%on thebodyis the usual control, and a 16 pixel base font size avoids the problem. - Outlook shows a white line between sections. That is an Outlook rendering issue rather than a responsive one; Outlook rendering fixes covers it.
Pre-send checklist
- The email works at 375 pixels with the
<style>block deleted: columns stack and nothing overflows. - Every container and column row has a matching ghost table, opened and closed.
- Column widths add up: column
max-widthtimes columns is no more than the padded cell width. font-size:0is on every cell that holds inline-block columns, and each column resets its font size.- The
<style>block is in the<head>, under 16 KB, with no CSS comments. - Every media query rule ends with a lowercase
!important. - The
[if mso]Arial rule is in the head, after any web font, which is hidden from Outlook. - Every image has pixel
widthandheightattributes andwidth:100%; max-width; height:autoinline. - Image files are twice their shown width.
- Mobile-only content is hidden inline and inside
<!--[if !mso]><!-->. - The viewport meta tag is in the
<head>. - Tested in classic Outlook for Windows, the Gmail app with a Google and a non-Google account, and iOS Mail. The email testing checklist lists the rest.
- The email stays under Gmail’s clipping size (Gmail clipped message).
Live images slot into the hybrid columns the same way as product photos. To put an email countdown timer from EmailTimer.app in one of the 270 pixel columns above, give its <img> the column’s image size in the attributes, width="250" and the matching height, and width:100%; max-width:250px; height:auto inline: classic Outlook then holds it at 250 pixels in the ghost table cell, and on a phone the .col img rule widens it with the stacked column. Make the file 500 pixels wide so it stays sharp at that width. The countdown timer generator gives you a snippet to paste into the column cell, and the free HTML email template already uses this hybrid layout.
Questions and answers
Do media queries work in email?
Yes, in most clients, but not all. Caniemail records support in Apple Mail, iOS Mail, Gmail with Google accounts, Yahoo Mail, AOL, Samsung Email and the Outlook apps, and no support in classic Outlook for Windows, Gmail’s apps with non-Google accounts, or Gmail’s mobile web version. Build the layout so it works without them.
Does Gmail support media queries?
Gmail on the web and the Gmail apps with a Google account support width, orientation and resolution queries, according to Google’s CSS page. Caniemail adds that height queries are not supported, and that the Gmail apps ignore <style> and media queries for non-Google accounts such as Outlook.com or Yahoo addresses. The <style> block must be in the <head> and under 16 KB.
Does Outlook support media queries?
Classic Outlook for Windows, 2007 to 2019, does not, because it uses Word’s rendering engine. Outlook.com, Outlook on the web, and Outlook for Mac, iOS and Android support them with one limit recorded by caniemail: nested media queries are removed. The new Outlook for Windows is built on WebView2 with the Outlook on the web experience, so treat it like Outlook on the web and test it.
What is a hybrid or spongy email?
It is a layout built from <div> columns with max-width and display:inline-block, which sit side by side when there is room and wrap under each other when there is not, with no media query needed. Classic Outlook gets fixed table cells through ghost tables in conditional comments. Spongy is another name for the same technique.
What breakpoint should I use for a responsive email?
Use your container width plus a little margin, such as 620 pixels for a 600 pixel email. Below that the email touches the screen edges, which is when the phone layout should take over. There is no need to target device sizes: a hybrid layout already adapts between breakpoints.
What is a ghost table in email?
A ghost table is a plain HTML table wrapped in <!--[if mso]> conditional comments, so only classic Outlook for Windows sees it. It gives Outlook fixed widths for a container or columns that other clients build from max-width and inline-block, which Outlook does not support.
How do I stack columns on mobile in an HTML email?
Make each column an inline-block <div> with width:100% and a pixel max-width, inside a cell with font-size:0. On a narrow screen the columns wrap under each other without any CSS in the head. Then add a media query that sets the columns to max-width:100% so they fill the screen once stacked.
Why do my columns not stack in the Gmail app?
If the reader uses a non-Google account in the Gmail app, your <style> block and media query are not applied. A layout that stacks only through a media query, such as tables switched to display:block, will then stay side by side. Inline-block hybrid columns wrap on their own and stack anyway.
Should I use max-width or max-device-width in email media queries?
Use max-width. Gmail supports both, but max-width is the one supported across Yahoo, AOL and the other clients in caniemail’s tests, and it also responds when a desktop window is narrow. max-device-width responds only to the physical screen size.
Can I use flexbox or CSS grid for a responsive email?
Not as the main layout. Caniemail shows display:flex unsupported in classic Outlook for Windows and not supported in the Gmail apps with non-Google accounts, and grid has similar gaps. Inline-block columns with ghost tables reach every client, so keep flexbox for small enhancements that can fail safely.
How do I make images responsive in email?
Put the shown size in pixel width and height attributes for Outlook, and add width:100%; max-width:600px; height:auto; display:block inline for everyone else, adjusting 600 to the slot. Save the file at twice the shown width. Avoid percentage widths in the attribute, since classic Outlook calculates them from the file’s own width.
Can I show different content on mobile and desktop in an email?
Yes, with classes and a media query: hide the mobile version inline with display:none, then show it and hide the desktop version inside the query. Wrap the mobile version in <!--[if !mso]><!--> so classic Outlook skips it. Clients that ignore the media query show the desktop version, so it must work on a phone too.
Do I need a viewport meta tag in an HTML email?
Include it. <meta name="viewport" content="width=device-width, initial-scale=1"> tells mobile clients that render in a browser view to use the device width instead of a zoomed-out desktop width, so your layout and media queries see the real screen size. It costs one line and is ignored where it is not needed.
Sources
- @media support by email client (Can I email, tested 13 December 2023), read on 21 November 2026
- <style> element support by email client (Can I email), read on 21 November 2026
- max-width support by email client (Can I email), read on 21 November 2026
- display support by email client (Can I email), read on 21 November 2026
- width attribute support by email client (Can I email), read on 21 November 2026
- srcset and sizes support by email client (Can I email), read on 21 November 2026
- dir attribute support by email client (Can I email), read on 21 November 2026
- !important support by email client (Can I email), read on 21 November 2026
- display:flex support by email client (Can I email), read on 21 November 2026
- CSS comments support by email client (Can I email), read on 21 November 2026
- Using MSO styles in email (Good Email Code, Mark Robbins), read on 21 November 2026
- CSS support (Gmail, Google for Developers), read on 21 November 2026
- Word 2007 HTML and CSS Rendering Capabilities in Outlook 2007, Part 1 of 2 (Microsoft Learn), read on 21 November 2026
- Overview of the new Outlook for Windows (Microsoft Learn), read on 21 November 2026
- <meta name="viewport"> (MDN Web Docs), read on 21 November 2026
- Columns (Good Email Code, Mark Robbins), read on 21 November 2026
- Template (Good Email Code, Mark Robbins), read on 21 November 2026
- Container (Good Email Code, Mark Robbins), read on 21 November 2026
- Creating a Future-Proof Responsive Email Without Media Queries (Nicole Merlin, Envato Tuts+), read on 21 November 2026
- Cerberus: responsive email patterns (emailmonday, GitHub), read on 21 November 2026
- MJML documentation: mj-column, mj-group and mj-breakpoint (MJML), read on 21 November 2026
Related
Put a countdown in the campaign you are writing now
The free plan covers 5,000 opens a month with no card. Starter is $24 a month for 250,000.