Media queries work in many modern email clients, but not reliably enough to carry your entire layout. The safest strategy is hybrid responsive email: create a fluid, readable default with tables and inline styles, then use media queries to improve stacking, spacing, type, and visibility on small screens.
What media queries can safely improve
Good uses include stacking columns, changing a container to full width, adjusting padding, making buttons full width, resizing headlines, or changing alignment. The message should remain understandable if every query is removed. That rule prevents most catastrophic responsive failures.
A mobile stacking example
Start with email-safe table columns:
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="stack-column w-1/2 pr-3 align-top">First column</td>
<td class="stack-column w-1/2 pl-3 align-top">Second column</td>
</tr>
</table>
Then preserve a responsive rule in the document head:
<style>
@media only screen and (max-width: 600px) {
.stack-column {
display: block !important;
width: 100% !important;
padding-left: 0 !important;
padding-right: 0 !important;
}
}
</style>
Your inliner should process the base utilities but leave the @media block intact. Flattening those declarations into every element destroys the breakpoint.
How Tailwind responsive utilities fit
Tailwindâs responsive variants are mobile-first: sm: means apply from the small breakpoint upward, not âapply only on a phone.â Email often needs a desktop-first override at a maximum width, so copying web patterns blindly can produce the opposite result.
Configure email-specific breakpoints or use named email classes for critical behaviors while Tailwind handles base styling. A class like .stack-column is easy to inspect and explains its purpose.
Build a fluid default first
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="center">
<table role="presentation" width="600" class="w-full max-w-[600px]" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="px-6 py-8">Email content</td>
</tr>
</table>
</td>
</tr>
</table>
The outer table supplies the fluid canvas, the inner table controls reading width, and cell padding keeps content away from screen edges. See email width, spacing, and containers for the full pattern.
Use !important selectively
Responsive rules often need !important to override inline declarations. In email it is a compatibility tool, but keep it limited to intentional overrides. A stylesheet filled with competing declarations becomes hard to reason about after inlining.
Avoid fragile responsive tricks
Do not make essential content depend on CSS Grid reordering, complex flexbox, container queries, hover, JavaScript, or advanced selectors. These may work in a browser preview and fail after a mailbox sanitizes the message. Use tables for primary structure and modern CSS for enhancements.
Be careful when hiding content
Hiding a desktop block and showing a second mobile copy adds duplicate markup. Some clients may display both, screen readers may repeat it, and the HTML grows. Prefer one adaptable block. Use swaps only when content truly needs a different order or treatment.
Keep media queries after inlining
A sound build sequence is:
- render components and placeholders;
- compile Tailwind utilities;
- inline base CSS;
- preserve supported media and dark-mode rules;
- minify carefully;
- test the final artifact.
If the inliner deletes the head or expands queries inline, fix its configuration. Read how to inline Tailwind CSS for the complete pipeline.
Test more than viewport width
A browserâs responsive mode is useful for quick iteration, but it does not reproduce an email clientâs sanitizer. Send the compiled message to Gmail, Apple Mail, Outlook desktop and web, then check dark mode, images off, and increased text size. Our email testing guide has a practical matrix.
Common media-query mistakes
Treating sm: as mobile-only. Tailwind breakpoints are min-width by default.
Depending on queries for readability. A client that ignores them still needs a usable message.
Inlining the query itself. Preserve breakpoint rules in a style block.
Repairing an overcomplicated desktop layout. Start with a simpler fluid structure.
Testing only a resized browser. Test the final sent HTML in real clients.
Frequently asked questions
Do media queries work in Gmail?
Many Gmail environments support common responsive queries, but support details vary. Build a readable fallback and verify the apps that matter to your audience.
Does Outlook support email media queries?
Outlook products do not share one rendering engine. Some handle responsive rules better than others; classic Windows Outlook is why email layouts should not depend on them.
Should Tailwind email use mobile-first breakpoints?
It can, but the source and output must match your fallback. Many teams prefer a fluid base plus explicit max-width overrides because the result is easier to inspect.
What breakpoint should an email use?
Choose it from the design, commonly near the 600-pixel container width. One purposeful breakpoint is often enough.
Share with friends