CSS Inliner for Email
Paste an email with a <style> block and get it back with the CSS inlined, the safest way to make it look right in every email app. Media queries and :hover rules stay in the <style> block, and Outlook gets width, height and bgcolor attributes.
Runs in your browser: the HTML isn’t uploaded or stored.
Options
Paste an email with a <style> block to inline its CSS.
Using the css inliner for email
Paste the full HTML of your email, with its CSS in a <style> block.
Choose the options: add width attributes for Outlook, and whether to keep the whole <style> block.
Copy or download the inlined HTML, then check its size with the Gmail clipping checker.
Why email CSS needs to be inline
Not every email app keeps the <style> block. Gmail drops it in some situations — for example in the Gmail app with a non-Gmail account — and some older apps ignore it. Styles written on each element (style="…") work everywhere, so inlining is the safest way to make sure the email looks as designed.
What stays in the <style> block
Media queries, :hover and other states, and rules aimed at a particular email app’s own markup (such as u + #body or [data-ogsc]) can’t be written inline, so they stay in the <style> block for the apps that read it. Rules that match nothing in your email stay as well.
Inline styles win over the <style> block, so the rules inside your media queries need !important to take effect on phones — the usual practice in email.
How conflicts are resolved
When several rules set the same property on an element, the inliner follows the CSS cascade: the more specific selector wins, then the later rule. Styles already written inline keep priority, unless a rule in the <style> block uses !important.
Questions, Answered
Does Gmail still need inline CSS?
Gmail supports <style> blocks in most cases, but drops them in some, such as the Gmail app with a non-Gmail account. Inline CSS works in all of them, so it’s still the safe choice for anything that matters.
Will my media queries still work?
Yes. Media queries stay in the <style> block. Because inline styles win over it, the rules inside them need !important to override the inlined styles.
What does “add width, height and bgcolor attributes” do?
Classic Outlook for Windows often ignores CSS widths on tables, cells and images but respects the HTML width attribute. With this option, a CSS width in pixels or percent is also written as a width attribute, and heights and background colours as height and bgcolor, where the element doesn’t already have one.
Does it change anything else in my code?
Your browser reads the HTML and writes it back, so the formatting can change a little: attribute quotes are made consistent, entities such as © become the character itself, and missing closing tags are added. Outlook conditional comments are kept as they are.
Is my HTML uploaded anywhere?
No. It’s inlined in your browser and isn’t uploaded or stored.
More free tools
- HTML Email CheckerPaste an HTML email or signature and get a list of what may break in Outlook, Gmail and other email apps, with the fix for each.
- Email Signature Size CheckerFix Gmail’s “Signature is too long” error: check your signature against the 10,000-character limit and get a shorter copy.
- Gmail Clipping CheckerSee your HTML email’s size against Gmail’s 102 KB limit, what makes it heavy, and get a smaller, minified copy.
- Bulletproof Button GeneratorDesign an email call-to-action button and copy HTML and VML code that works in Outlook, Gmail and Apple Mail, with no images.
- Outlook Background Image GeneratorBackground images that show in classic Outlook too: copy HTML and VML code with your image, size and fallback colour.
- WordPress to Next.js Redirect GeneratorPaste your WordPress URLs or sitemap and get 301 redirects for next.config.js, vercel.json or Netlify’s _redirects.
- Email Template & Signature EditorEdit an HTML email template or signature without touching the code.
Need an HTML email built or fixed?
I code responsive HTML email templates and signatures that work in Outlook, Gmail and Apple Mail, or fix the one you already have. Tell me what you need.