MailBuildrMailBuildr.com
Blog/Guide

How to build an HTML email that works in Gmail and Outlook

October 14, 2026·10 min read

In short

  • Lay out the email with nested <table> elements and a 600-pixel content column.
  • Write styles inline, in the style attribute of each element.
  • Give images explicit widths, display:block and alt text.
  • Build buttons from a table cell, not from padding on a link alone.
  • Preview at desktop and mobile widths, check the code, then send a real test.

An email that looks perfect in your browser can fall apart in an inbox: columns collapse in Outlook, styles vanish in Gmail, buttons turn into plain links. None of this is random. Each client applies its own rules, and a handful of techniques covers almost all of them.

Why Gmail and Outlook break emails

  • Outlook for Windows (the classic desktop app) renders HTML with Microsoft Word's engine. It ignores flexbox, grid, floats, most positioning, max-width on many elements and CSS background images. Microsoft is moving to a new Outlook based on a browser engine, but the classic version will stay in companies for years.
  • Gmail rewrites the HTML it receives. It supports a <style> block in many cases but removes it in others (for example in some forwarded or non-Google-account contexts), and it drops styles it considers unsafe. Inline styles are the safest bet.
  • Mobile apps display the email in a column around 320 to 400 pixels wide and may rescale it.

The answer is to write for the weakest client: tables for layout, inline styles for appearance, and conservative CSS.

1. Structure: tables and a fixed width

Use an outer table at 100% width for the background color, and an inner table 600 pixels wide, centered, for the content. Add role="presentation", cellpadding="0", cellspacing="0" and border="0" to every layout table so screen readers do not announce them as data tables and Outlook does not add gaps.

For the inner table, set both the HTML attribute and the style: width="600" for Outlook, and style="width:100%; max-width:600px" for clients that support it. Outlook reads the attribute; the others shrink the table on small screens.

Columns are table cells side by side. Give each cell a fixed width, and avoid nesting more than three or four levels deep: every level is another chance for Outlook to miscalculate a width.

💡 Tip: Put padding on <td> cells rather than on <p> or <div>. Outlook handles cell padding reliably and ignores margins in many places.

2. Inline CSS

Every visual style goes in the style attribute of the element it applies to: <td style="padding:24px; background-color:#ffffff;">. A style written inline travels with its element; nothing a client strips from the <head> can affect it.

Keep a short <style> block only for what cannot be inline: media queries and a few client-specific fixes. Design the email so it stays readable if that block is ignored.

If you already have HTML written with a stylesheet, a CSS inliner copies each rule into the matching elements. Our free CSS inliner does this in the browser and keeps media queries.

⚠️ Avoid: display:flex, display:grid, float, position, CSS variables and shorthand values Outlook may misread (prefer padding-top, padding-right… when in doubt). Write colors as six-digit hex codes.

3. Images

  • Set the width attribute in pixels (Outlook uses it), plus style="display:block; width:100%; max-width:600px; height:auto;" for responsive clients. display:block removes the gap that appears under images in some clients.
  • Always add meaningful alt text: many clients block images until the reader allows them, and the alt text is all they see.
  • Host images on a public HTTPS URL. Avoid SVG and WebP for important images: support is inconsistent. PNG and JPEG are safe; GIF works, but Outlook for Windows shows only the first frame.
  • Do not put essential text inside an image: it is invisible when images are blocked and unreadable for screen readers.

4. Buttons

A link with padding looks like a button in Gmail but often shrinks to plain text in Outlook, which ignores padding on inline elements. The reliable pattern is a "bulletproof" button: a table cell with a background color and padding, containing the link.

In practice: a one-cell table, <td style="background-color:#ff5a00; border-radius:8px;">, and inside it <a href="…" style="display:inline-block; padding:12px 28px; color:#ffffff; text-decoration:none;">. Outlook ignores the rounded corners and shows a square button, which is an acceptable fallback. For pixel-perfect rounded buttons in Outlook, some teams add VML in conditional comments, at the cost of more complex code.

5. Fonts and text

Web fonts load in Apple Mail and some mobile clients, but not in Gmail or Outlook for Windows. Always declare a fallback stack, such as font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;. Classic Outlook can fall back to Times New Roman when it does not recognize a font, so put a safe system font in every stack.

Set font-size and line-height explicitly on each text cell, in pixels. Keep body text at 14 to 16 pixels: smaller text gets enlarged automatically by iOS, which can break the layout.

6. Mobile

Start from a single-column layout: it needs no media query and reads well everywhere. For multi-column sections, add a media query that makes each column display:block; width:100% below about 480 pixels, so columns stack. Clients that ignore the media query will show the columns side by side, scaled down, which is why a 600-pixel maximum width matters.

Make buttons at least 44 pixels high and leave space around links so they are easy to tap.

7. Testing routine

  1. Preview the layout. Paste the HTML into our free email preview tool and switch between Gmail, Outlook, desktop and mobile widths to spot overflowing text or columns that do not stack.
  2. Check the code. The email compatibility checker lists the tags and CSS properties that Gmail, Outlook, Apple Mail or Yahoo do not support.
  3. Send a real test to accounts on Gmail, Outlook (desktop app if possible) and a phone. Check images, links, the unsubscribe link and the plain-text version.
  4. For critical campaigns, a screenshot service such as Litmus or Email on Acid renders the email in dozens of real clients. A browser preview cannot reproduce Outlook's Word engine exactly.

Writing all of this by hand is slow and error-prone. A block-based HTML email editor generates the tables, inline styles, image attributes and bulletproof buttons for you, so you can spend your time on the content and on testing.

Skip the table debugging

Assemble headings, text, images and buttons: MailBuildr outputs table-based HTML with inline CSS for Gmail and Outlook. Try the demo without an account.

Open the HTML email editor →

FAQ

Why does my HTML email look different in Outlook?

The classic Outlook for Windows renders HTML with the Word engine, which ignores flexbox, grid, floats, many margins and CSS background images. Use tables for layout, inline styles, and padding on table cells.

Does Gmail support CSS in the head of an email?

Partly. Gmail supports a style block in many situations but removes it in others and drops some properties. Inline styles are the only approach that works in every case, so keep the style block for media queries.

What width should an HTML email be?

Around 600 pixels for the content column is the usual choice: it fits in the reading pane of desktop clients and scales down well on mobile.

How do I test an HTML email before sending it?

Preview it at desktop and mobile widths, run a compatibility check on the code, then send real tests to Gmail, Outlook and a phone. For important campaigns, add screenshots from a service such as Litmus or Email on Acid.

Ready to start?

Build an HTML email that holds up in Gmail and Outlook

Block editor, table-based export with inline CSS, test email before sending. Free to start.

Try MailBuildr →