CSS Inliner for Email
Paste your HTML and CSS to inline all stylesheet rules into style attributes — ready for email clients
Paste your HTML email template and its stylesheet, hit one button, and every CSS rule gets written directly into each element's style attribute — exactly the way Gmail, Outlook, and Yahoo need it. No more hand-copying background-color onto forty <td> tags.
And everything runs in your browser. Nothing gets uploaded.
How It Works
The parser reads your <style> block first, splits every rule into a selector and its declarations, then walks through your HTML looking for matches. Each matching element gets the CSS properties written into its style attribute. Specificity works correctly — if two rules target the same element, the more specific one wins. And pseudo-classes like :hover get skipped since they can’t exist inline. They end up in a separate <style> block instead.
Examples
Newsletter Header Bar
Dark header with white text — the most common email pattern that breaks without inlining.
<style>
.header { background: #1a1a2e;
padding: 20px; }
.header h1 { color: #fff;
font-size: 24px; }
</style>
<div class="header">
<h1>Weekly Update</h1>
</div><div class="header" style="background:
#1a1a2e; padding: 20px;">
<h1 style="color: #fff;
font-size: 24px;">Weekly
Update</h1>
</div>CTA Button with Hover State
Email clients ignore :hover. So the inliner grabs the base styles and drops the pseudo-class — your button still looks good without hover support.
<style>
.cta { background: #e63946;
color: #fff; padding: 12px 28px;
border-radius: 4px;
text-decoration: none;
font-weight: bold; }
.cta:hover { background: #c1121f; }
</style>
<a class="cta" href="#">Shop Now</a><a class="cta" href="#"
style="background: #e63946;
color: #fff; padding: 12px 28px;
border-radius: 4px;
text-decoration: none;
font-weight: bold;">Shop Now</a>Product Grid with Table Layout
Three-column product layout using table cells. Every cell, image, and price tag picks up its own styles so nothing shifts when Gmail strips the stylesheet.
<style>
.products { width: 100%; }
.cell { width: 33%; padding: 10px;
vertical-align: top; }
.cell img { width: 100%;
border-radius: 6px; }
.price { color: #2d6a4f;
font-size: 18px; font-weight: 700; }
</style>
<table class="products">
<tr>
<td class="cell">
<img src="shoe.jpg">
<p class="price">$89</p>
</td>
<td class="cell">...</td>
</tr>
</table><table class="products"
style="width: 100%;">
<tr>
<td class="cell" style="width: 33%;
padding: 10px;
vertical-align: top;">
<img src="shoe.jpg"
style="width: 100%;
border-radius: 6px;">
<p class="price"
style="color: #2d6a4f;
font-size: 18px;
font-weight: 700;">$89</p>
</td>
...
</tr>
</table>Who Uses This
Inline styles into Mailchimp, SendGrid, or MJML templates before deploying campaigns across 30+ email clients.
Check how styled email HTML actually renders after inlining — without sending a test every single time you tweak a color.
Fix promo emails that looked fine in the editor but broke in Outlook. Paste, inline, paste back. Quick fix.
Last step before your app sends transactional emails like order confirmations, password resets, or shipping notifications.
Common Mistakes
If your CSS lives in a separate file and you only paste the HTML body, the inliner finds zero rules to apply. Output looks identical to input. Use the separate CSS pane below the HTML input, or include the <style> tag directly in your HTML.
Pseudo-classes and media queries can’t exist in a style attribute. The inliner skips them, which looks like missing styles. But that’s correct behavior. Keep a <style> block in your email just for those rules — most ESPs support it alongside inlined styles.
background: #fff is shorthand. Outlook desktop sometimes only reads background-color. And the inliner moves exactly what you wrote — it won’t expand shorthands for you. So write background-color explicitly when targeting Outlook.
Technical Details
- Processing: 100% client-side — HTML never leaves your browser
- Input Limit: No hard cap; files over 500 KB may slow older devices
- Selectors: Classes, IDs, elements, descendant combinators, attribute selectors
- Browser Support: Chrome, Firefox, Safari, Edge
- Preserves: Existing inline styles, !important flags, HTML structure
Frequently Asked Questions
Why do email clients strip CSS style tags?
Email clients like Gmail render your message inside their own HTML page. If your stylesheet had a rule like body { margin: 0 }, it would mess with the webmail layout itself. So stripping stylesheets is a security and UX decision on their end. Inline styles only affect the element they sit on, which is why email clients leave those alone.
Does CSS inlining work for Outlook?
Yes, and honestly Outlook is the biggest reason you need it. Outlook desktop (2007 through 2021) uses Word’s rendering engine, which barely supports CSS. Inline styles give you the best shot at consistent results. But stick to basics — background-color, font-family, padding, and explicit width values.
Can I inline CSS for responsive emails?
Partially. @media queries can’t be inlined — they don’t belong in a style attribute. The standard approach is to inline all your base styles, then keep a separate <style> block just for media queries. Most email clients that support responsive design also support embedded style blocks, so this works fine.
Is my HTML sent to a server when I use this tool?
No. The whole thing runs in JavaScript inside your browser tab. Nothing gets uploaded, stored, or logged. You can disconnect from the internet after loading the page and it still works. Not a marketing claim — check the Network tab in DevTools if you want proof.
What CSS selectors does the inliner support?
It handles class selectors (.btn), IDs (#header), element selectors (td), descendant combinators (.wrapper p), and attribute selectors ([align="center"]). Pseudo-classes like :hover and pseudo-elements like ::before get skipped because they have no inline equivalent. That’s not a bug — there is no way to put :hover in a style attribute.