Start a project

Tool 57 of 100 · Email

Email CSS Inliner

Write email HTML with a normal stylesheet and get inline styles that Gmail and Outlook respect, with responsive rules kept and the cascade worked out properly.

Email CSS Inliner at a glanceIllustration: 1, HTML email + CSS; 2, processed in your browser; 3, Inlined, client-safe HTML.Email CSS Inliner@1HTML email + CSS</>3Inlined, client-safe HTML2In yourbrowser
1 HTML email + CSS 2 processed on your device 3 Inlined, client-safe HTML

Email CSS Inliner

Email HTML with a <style> block

Inlined

    Email HTML with inline styles

    01

    What it does

    Inlines CSS into HTML email the way the cascade would, keeps media queries in a style block and adds Outlook-friendly attributes.

    • Specificity, source order and !important handled
    • Existing inline styles kept
    • @media and :hover kept in a <style> block
    • width, align and bgcolor attributes for Outlook

    02

    Private by design

    Everything happens in your browser. Nothing you type, paste or upload is sent anywhere, and it keeps working offline once the page has loaded.

    03

    What you get

    Email-ready HTML, with a Copy and a Download button on every result.

    • Email
    • CSS
    • Outlook
    • Gmail

    Why it matters

    Many email clients strip or ignore <style> blocks, so email HTML has to carry its styles on every element. Writing them inline by hand is miserable, and simple inliners get the cascade wrong, letting a weaker rule overwrite a stronger one.

    This inliner works out the winning value for each property the way a browser would, keeps rules that can't be inlined (media queries and hover states) in a style block for the clients that read it, and adds the old HTML attributes Outlook on Windows still relies on.

    How it works

    1. InputAn HTML email with a style block
    2. In your browserRules applied by specificity, media queries kept
    3. OutputHTML with inline styles and a client check

    Where it fits in a designer's workflow

    1. Plan
    2. Design
    3. Build
    4. Test
    5. Launch
    Before an email goes to Gmail, Outlook and Apple Mail.

    By the numbers

    The sample email's CSS rules by specificitybody: (0, 0, 1) · 3 declarations; .wrap: (0, 1, 0) · 2 declarations; h1: (0, 0, 1) · 3 declarations; p: (0, 0, 1) · 3 declarations; .muted: (0, 1, 0) · 2 declarations; td.cta: (0, 1, 1) · 3 declarations; .cta a: (0, 1, 1) · 3 declarationsbody(0, 0, 1) · 3 declarations.wrap(0, 1, 0) · 2 declarationsh1(0, 0, 1) · 3 declarationsp(0, 0, 1) · 3 declarations.muted(0, 1, 0) · 2 declarationstd.cta(0, 1, 1) · 3 declarations.cta a(0, 1, 1) · 3 declarations
    Parsed by this tool's own CSS reader. Rules are inlined in specificity order, so .cta a beats a plain p on the same element, exactly as a browser would cascade them. 2 rules (like @media queries) can't be inlined and stay in a style block. Source: Can I email: style element.
    Show the numbers as a table
    SelectorSpecificityDeclarations
    body(0, 0, 1)3
    .wrap(0, 1, 0)2
    h1(0, 0, 1)3
    p(0, 0, 1)3
    .muted(0, 1, 0)2
    td.cta(0, 1, 1)3
    .cta a(0, 1, 1)3

    How to use it

    1. Paste your email HTML with its <style> block.
    2. Choose whether to keep the style block and add Outlook attributes.
    3. Check the report of inlined and kept rules.
    4. Copy or download the inlined HTML.

    FAQ

    Does Gmail support style blocks now?

    Gmail supports some &lt;style&gt; CSS, but strips it in several cases, such as forwarded mail. Inline styles are still the safe default.

    Why keep media queries?

    They can't be inlined, and clients like Apple Mail use them to make the email responsive.

    Is any script run?

    No. The HTML is parsed in an inert document; scripts don't run and images aren't loaded.

    Will it fix every Outlook issue?

    No tool can. It adds the common attributes, but Outlook's Word engine still needs tables for layout.

    Work with me

    Want a site that gets these right?

    I build fast, accessible websites and web apps that pass these checks from day one. Tell me about your project and I'll reply personally with honest next steps.

    All developer tools · Back to leej.uk