Email CSS Inliner
Inline CSS into style attributes so Gmail and Outlook keep your email's look.
Email HTML
5 lines · 153 charsCSS to inline
5 lines · 192 charsInlined HTML
5 inlinedDetails
Gmail and several webmail clients strip <style> blocks, so emails designed with a stylesheet can arrive unstyled. This inliner applies element, class and ID rules to matching tags' style attributes, respecting cascade specificity and !important, while leaving existing inline styles intact. Selectors that cannot be inlined — pseudo-classes, descendant selectors and at-rules — are listed in the report so you know what still depends on the head style block. Your template never leaves the browser.
More examples
Newsletter card
.card { background: #fff; padding: 16px }
h1 { color: #222 }Each matching tag gets a style attribute; the HTML structure is otherwise unchanged.
Important override
<p style='color: blue'>Hi</p>
p { color: red !important }An existing inline style normally wins; !important replaces it and the report counts the override.
Hover and media rules
a:hover { color: red }
@media (max-width:600px) { .card { padding: 8px } }These rules cannot be represented as inline styles, so they are reported rather than silently discarded.
Examples
Newsletter card
.card { background: #fff; padding: 16px } plus <div class='card'><div class='card' style='background: #fff; padding: 16px'>The class rule becomes a style attribute without changing the surrounding markup.
Important override
<p style='color: blue'>Hi</p> plus p { color: red !important }<p style='color: red'>Hi</p>Only !important beats an existing inline declaration; the override is counted in the report.
Hover rule
a:hover { color: red }Reported as not inlinablePseudo-classes cannot exist in an inline style attribute, so silently dropping them would mislead you.
Media query
@media (max-width:600px) { .card { padding: 8px } }At-rule preserved in the report; no inline changeMany mobile email clients still apply media queries from the head; the rule is reported, never silently lost.
About this tool
Email CSS Inliner applies stylesheet rules to the matching tags in your email template, writing them into style attributes. This is the compatibility layer Gmail, Outlook and many webmail clients need, because they strip or ignore a <style> block in the message body.
Element, class and ID selectors are resolved with normal specificity, and existing inline styles keep their priority unless a rule uses !important. The report lists every rule that cannot be inlined — hover states, descendant selectors, at-rules — so you can decide whether to keep it in the head block or replace it with an email-safe alternative.
The tool changes only style attributes: comments, conditional Outlook blocks, table structure and links stay exactly as pasted. Templates are processed entirely in the browser and are never uploaded.
What this tool does not do
- Only single element, class and ID selectors are inlined; complex selectors are reported, not transformed.
- At-rules such as @media are reported but not injected into the document head.
- CSS custom properties are left literal and are not resolved.
- JavaScript, remote images and linked stylesheets are neither fetched nor executed.
- Layout-affecting email client quirks (for example Outlook's Word renderer) are outside the tool's scope.
How to use this tool
Paste the HTML
Copy the email template into the Email HTML pane. Conditional comments and links are preserved.
Paste the CSS
Copy the contents of your <style> block or linked stylesheet into the CSS pane. At-rules are recognized.
Review the report
Check the inlined/override counts and the reported pseudo-class or media rules that still need a head style block.
Copy the result
Copy or download the inlined HTML for your email service provider or ESP template.
Use cases
ESP templates
Prepare HTML for Mailchimp, Customer.io or custom sending infrastructure.
Transactional email
Make password resets and receipts look consistent across Gmail and Outlook.
Design handoff
Turn a styled HTML mockup into email-safe markup with a transparent report.
Debugging
Find rules that email clients cannot honor before a campaign ships.
Selector handling
| Selector | Behavior |
|---|---|
| p, h1, td | Inlined on every matching tag |
| .class | Inlined on tags carrying the class |
| #id | Inlined with higher specificity than classes |
| a:hover, :focus | Reported as not inlinable; keep in the head style block |
| @media (…) | Recognized and reported; mobile clients may still honor it |
| Existing style attribute | Kept unless an !important rule overrides it |
CSS custom properties are kept literally because most email clients do not resolve them.
Common mistakes
Mistake:Expecting hover and descendant selectors to work inline.
Fix:They cannot become style attributes; keep them in a head style block or use email-safe alternatives.
Mistake:Assuming CSS variables resolve in Gmail.
Fix:Most clients do not support custom properties; use literal values in email CSS.
Mistake:Overwriting inline styles unintentionally.
Fix:The inliner keeps existing declarations unless a matching rule is marked !important.
Mistake:Running an inliner over conditional Outlook comments as CSS.
Fix:Conditional comments are preserved verbatim and never parsed as styles.
Mistake:Uploading a template to a random online service.
Fix:This tool performs the transformation locally; nothing leaves the browser.
Frequently asked questions
Why do HTML emails still need inline style attributes?
Several email clients—including Gmail clip views, forwarding views, and legacy enterprise clients—strip or partially ignore <style> blocks, so writing declarations onto element style attributes preserves layout and typography.
What happens to @media queries and :hover rules?
Media queries and pseudo-classes cannot be expressed inside an inline style='' attribute; the inliner preserves <style> blocks when configured and lists non-inlinable selectors explicitly in the diagnostics report.
How are specificity and !important resolved?
Matching element, class, and ID rules merge according to CSS cascade specificity and source order, with existing inline styles winning unless a stylesheet rule carries !important.
Is my HTML newsletter template uploaded to a server?
No. CSS parsing, cascade resolution, and HTML serialization run entirely in your browser.
References & standards
Related tools
.env Secret Safety Linter
Validate .env syntax and spot likely leaked credentials or placeholder secrets.
.gitattributes Generator
Build .gitattributes rules for line endings, Git LFS, GitHub linguist marks and merge drivers — with a one-line explanation for every rule.
.htaccess Generator
Build an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth
2D Fluid Dynamics & Particle Physics Sandbox
A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.
A/B Test Sample Size Calculator
Compute required sample size per variant and test duration from baseline conversion rate, minimum detectable effect, alpha and power.
ABA Routing Number Validator
Validate 9-digit US ABA routing numbers with 3-7-1 Mod-10 breakdown.