CSS Inliner

Convert stylesheet rules into inline style attributes for email templates and single-file pages.

CSS Inliner

CSS inliner tool

The CSS inliner matches HTML elements with browser selectors and writes declarations into style attributes. It supports tags, classes, IDs, descendant selectors, attribute selectors, existing inline styles, and optional style-tag removal. It is useful for HTML email, offline pages, single-file documents, and portable templates.

Good for HTML email

Inlining rules can improve compatibility with email clients that limit external stylesheets.

Respect cascade order

Rules are applied in CSS order, existing inline style is merged last, and important declarations retain priority.

Clear limitations

Nested at-rules such as media, supports, and keyframes are not inlined as ordinary selectors and are reported.

How to use

  1. Paste HTML and CSS, or leave CSS empty to read style elements from the HTML.
  2. Choose whether to keep style tags and DOCTYPE, then inline the CSS.
  3. Check the generated style attributes, then copy or download the standalone HTML.

FAQ

Why are media rules not put into style?

Media queries and keyframes need to remain CSS rules; putting them on each element would change their meaning. The tool inlines ordinary selectors and warns about these rules.

Are scripts executed?

No. HTML is parsed with DOMParser and scripts are not executed by the conversion. Review any scripts in the output in your own project environment.

Recommended utilities

You may also need these file utilities