Inline CSS is CSS written directly on an HTML element through its style attribute, for example:
What is inline CSS in email? A delivery baseline, not the only way to author styles
<td style="padding:24px; background:#ffffff; color:#111111;"> Product update</td>
Inline styles became a common email baseline because older and more restrictive clients often handled element-level declarations more reliably than complex stylesheet rules. But the stale rule "all email CSS must be inline" is no longer accurate. Gmail officially supports inline styles and <style> blocks, selectors, and standard media queries within its supported subset. Can I Email also shows broad, though not universal, support for the <style> element.
The useful distinction is between authoring CSS and delivered CSS.
Author cleanly, then decide what the delivery HTML needs
Writing a large template entirely as hand-maintained inline styles creates duplication:
<td style="font-family:Arial,sans-serif;font-size:16px;line-height:24px;color:#333333;">...</td><td style="font-family:Arial,sans-serif;font-size:16px;line-height:24px;color:#333333;">...</td>
A maintainable build can instead author shared classes:
<style> .body-copy { font-family: Arial, sans-serif; font-size: 16px; line-height: 24px; color: #333333; }</style>
Then an inliner can copy selected declarations onto the relevant elements for delivery. The source stays maintainable while the output gains a stronger compatibility baseline. This is why "inline CSS" should describe a rendering strategy, not force marketers or designers to edit unreadable final HTML.
What is worth inlining
Inline styles are most useful for declarations that define the baseline appearance of important components:
- typography
- text and background colors
- table-cell padding
- width/height constraints where appropriate
- borders
- alignment
- display-safe button styling
Classic Outlook makes spacing a concrete example. Microsoft's email-rendering troubleshooting guidance says classic Outlook uses a Word-based HTML processing engine with limited support for standard CSS margins and padding, and recommends padding on the td elements that define layout when custom HTML is used.
That does not mean every property must be inlined. It means the baseline should be expressed in a form the required clients can actually use.
Some CSS cannot simply be "inlined"
Media queries are conditional rules. A build tool cannot replace this:
@media screen and (max-width: 600px) { .stack { display:block !important; width:100% !important; }}
with one unconditional style attribute without changing its meaning. Gmail documents media-query support, and current compatibility data shows broad but partial @media support across email clients. So a sensible delivered email can contain both:
- inline declarations for the baseline
- a
<style>block for responsive or state-dependent enhancement
This hybrid model is more accurate than choosing "inline vs stylesheet" as if only one can exist.
The inliner is part of the rendering pipeline
Treat CSS inlining as a build transformation:
Author once, inline for the delivered baseline
- 1Component or source stylesShared classes, authored once.
- 2Build or inlinerCopies critical declarations onto each element.
- 3Delivered inline baselineTypography, color and padding land inline.
- 4Remaining style-block enhancementsMedia queries and states stay conditional.
- QA on the sent HTMLTests the transformed output, not the source.
authored component styles → compiled template → inliner → final email HTML → client sanitization/rendering Every transformation can create defects. An inliner can:
- increase HTML size substantially
- change specificity
- duplicate declarations
- accidentally override a responsive rule
- mishandle unsupported selectors
- turn a small source change into a very large output diff
Therefore, the final delivered HTML is what QA should render, not only the pre-inlined source template.
Specificity becomes an operational concern
Suppose the baseline output contains:
<td class="card" style="width:50%;">and the mobile stylesheet contains:
@media screen and (max-width:600px) { .card { width:100%; }}
If the inline declaration wins in a target client, stacking fails. The team may need a deliberate !important in the responsive override, or a different component structure. The lesson is not "always use !important." It is that the cascade after inlining must be designed intentionally.
Style blocks are no longer an automatic red flag
Can I Email currently estimates substantial combined support for <style>, while documenting client-specific limitations such as placement rules and size constraints. Gmail likewise documents support for style blocks and a supported selector/property subset. So this is a better rule: > Put critical baseline styling where your required clients can consume it; use style blocks for shared rules and conditional enhancement where your support matrix allows it. That rule can survive client evolution. "Inline everything" cannot.
Worked example
An email build that checks CSS compatibility might use:
- 1. a table structure that remains readable as 2 columns
- 2. inline padding, typography, background, and baseline width
- 3. a
<style>block containing the narrow-screen stacking rule - 4. a post-build inliner configured not to destroy the media query
- 5. client tests of the post-build HTML
If the media query is ignored, the baseline is still usable. If it is honored, the card becomes more comfortable on a phone. That is progressive enhancement expressed through the CSS pipeline.
Common mistakes
- Hand-authoring production inline HTML as the source of truth. It creates duplication and makes design-system changes unnecessarily risky
- Inlining media-query declarations unconditionally. That destroys the condition that made the responsive rule meaningful
- Assuming a class-based source preview proves the delivered email. The inliner can change specificity or output size
- Using margins for critical classic-Outlook spacing without testing. Table-cell padding is often the safer structural baseline for that client
- Keeping every historical compatibility hack forever. Revalidate old rules against current client requirements instead of accumulating permanent template archaeology
Questions we get asked
Does Gmail support `<style>` blocks?
Yes, within Gmail's documented CSS support model. Gmail also supports many selectors and standard media queries, while unsupported CSS may be ignored.
Do I still need inline CSS?
For many production email systems, inline styles remain a useful baseline because the client landscape is fragmented. But they can be generated at build time rather than manually maintained.
Can an inliner handle responsive CSS?
A good email build pipeline preserves conditional rules such as media queries while inlining the baseline rules that benefit from it. Test the actual output because tool behavior varies.
Is inline CSS automatically compatible with Outlook?
No. Inline placement does not make an unsupported property supported. Classic Outlook's rendering engine still has its own HTML/CSS constraints.
OnVoard's take
The cleanest mental model is: author for humans, compile for email clients. Keep maintainable component styles in the source, inline what improves the baseline, preserve conditional enhancements, and validate the final HTML that recipients actually receive.
Every app on every plan. Connect your store and switch on the flows in an evening.