Home / Developer Tools / CSS Inliner
Free online tool

CSS Inliner

Apply supported stylesheet rules directly to matching HTML elements as style attributes for email and portable snippets. Processing takes place locally in yo…

Start using

What CSS Inliner does

Apply supported stylesheet rules directly to matching HTML elements as style attributes for email and portable snippets.

Worked example

Input

<style>p{color:blue}</style><p>Hello</p>

Result

<p style="color: blue;">Hello</p>

How it works

The tool parses HTML and supported CSS selectors, matches rules to elements and merges declarations into inline style attributes according to the implemented precedence rules.

Developer workflows

  • Prepare HTML email markup
  • Create self-contained HTML fragments
  • Inspect computed rule precedence in a small sample

Security and compatibility checks

  • Complex selectors, media queries and pseudo-classes may not inline cleanly.
  • Email clients support different subsets of HTML and CSS.
  • Sanitize untrusted HTML before displaying or sending it.

Frequently asked questions

Why are media queries still in a style block?

Responsive rules cannot always be represented as static inline declarations.

Does inline CSS guarantee identical email rendering?

No. Test with the actual email clients and delivery system you support.

Processing takes place locally in your browser.