Skip to content
mailer.tools

CSS inliner for email

Paste email HTML with a style block and get the same email with every rule written into the elements. Media queries and hover rules stay in the head, where they still work.

Runs entirely in your browser. Nothing you type or paste is uploaded.

Loading the tool

How to use the CSS inliner

  1. 1Paste HTML that contains one or more <style> blocks.
  2. 2Choose whether to strip unused classes and add Outlook attributes.
  3. 3Press Inline CSS.
  4. 4Copy the result, or download it as an .html file.

How the inliner decides which rule wins

Rules are applied the way a browser would apply them: higher specificity beats lower, later rules beat earlier ones at the same specificity, and !important beats both. A style attribute already on an element wins over the stylesheet unless the stylesheet rule is marked !important.

Rules that cannot be expressed inline are left in a <style> block: media queries, @font-face, and selectors with :hover or other states. With Outlook attributes on, widths, heights, background colours and alignment are also written as HTML attributes, which Outlook on Windows trusts more than CSS.

Questions about the CSS inliner

Why do emails need inline CSS?

Several clients remove <style> blocks in some situations, and forwarded mail often loses them. Inline styles are the only styling that reliably reaches every inbox.

Does it keep my media queries?

Yes. Media queries cannot be inlined, so they stay in a style block in the head, where clients that support them (Apple Mail, Gmail, Outlook.com) will read them.

Is my HTML sent anywhere?

No. Parsing and inlining use your browser's own HTML parser. Nothing leaves the page.