Email HTML CSS Inliner (style Blocks to style Attributes)
Moves CSS rules onto matching elements as inline styles, the way many email clients need.
Use the tool
Why this tool exists
Several email clients ignore or strip style blocks, so rules must sit on each element. Doing that by hand is slow and easy to get wrong.
The tool parses your style blocks, matches selectors (tag, class, id, attribute, child, descendant and sibling combinators, first-child, last-child, nth-child, not) against your HTML, applies them in specificity order, honours !important, and lets existing inline styles win. Rules it cannot inline, such as media queries and :hover, stay in a style block in the head. Linked stylesheets cannot be fetched, so paste the CSS into a style block.
How to use it
- Paste HTML that contains a style block.
- Read the summary comment at the top.
- Copy the result into your email template.
- Test in the mail clients you target.
Frequently asked questions
Are media queries lost?
No. They stay in a style block, which most modern clients support.
Which selectors work?
Tag, class, id, attributes, combinators, first-child, last-child, only-child, nth-child and not. Others are kept in the style block.
Does it add table layouts?
No. It only moves CSS.