CSS Email Inliner (Style Attribute Inliner)
Turn HTML with a <style> block into email-ready markup with every CSS rule moved into inline style=”” attributes. Email clients strip or ignore <style> blocks, so inlining is the only reliable way to keep your design intact across Gmail, Outlook, Yahoo, and Apple Mail.
Paste your full HTML on the left; the tool parses every selector, resolves CSS specificity exactly the way browsers do, and writes the winning declarations onto each matching element. Pseudo-class rules like :hover and any @media query are kept in a residual <style> block, since email clients that support them still need them there.
How to Use
- Paste your HTML — full document or fragment with a <style> block — into the input field.
- Decide whether to keep media queries and pseudo-class rules (recommended for responsive email).
- Optionally strip class attributes from the output once the styles are inlined.
- Toggle pretty-print on or off depending on whether you want a readable or compact result.
- Copy the inlined HTML or download it as a file, then drop it straight into your email service provider.
Features
- Specificity-aware merging – Resolves IDs, classes, attributes, and element types exactly like the browser cascade.
- !important handling – External !important declarations correctly beat plain inline styles, matching the CSS spec.
- Media query preservation – Responsive @media rules are kept intact so your mobile breakpoints still fire.
- Pseudo-class fallback – :hover, :focus, and ::before rules can’t be inlined; the tool keeps them in a slimmed-down <style> block.
- Multiple <style> blocks – Handles documents with several style tags in the <head> or <body>.
- Optional class stripping – Remove now-redundant class=”” attributes for a leaner payload.
- Pretty-print output – Indented, readable HTML or compact one-line output.
- 100% client-side – Your HTML never leaves the browser. No upload, no server processing.