Sub topic 10
Build a Reliable CTA Button in HTML Email
This chapter shows how to build the call to action (CTA) button as HTML that renders the same way in most email clients. It assumes you know basic HTML and CSS, and that you have read the earlier chapters on choosing a single CTA, writing its copy and designing it. Here the decisions are already made. The task is to implement them so the button works in Gmail, Apple Mail, Outlook for Windows and the mobile apps.
Why a button needs special handling
Web CSS does not carry over to email. Email clients strip or ignore parts of it, and the support differs between clients. Three differences matter for buttons:
- Many clients remove
<style>blocks or rewrite them, so important styles go inline, on the element. - Outlook for Windows renders HTML with the Microsoft Word engine. It ignores padding on
<a>elements and has poor support forborder-radius. - Some clients block images by default. A button that is a picture can show up as an empty box.
The goal is a button that degrades gracefully. At worst, a client shows a plain, readable link to the right URL. It never shows a missing or broken button.
Prefer a live-text button over an image
A button made as an image looks the same everywhere it loads. It fails in three ways:
- With images blocked, the reader sees nothing, or only the alt text, with no color or shape.
- Screen readers depend on the alt text, which is easy to forget or mistype.
- Changing the copy for a test means exporting a new image.
A button built from text and a background color avoids all three. The CTA is then real text, and you can change it without a design tool.
The table-based button
The common pattern puts the background color on a table cell and the text link inside it. Tables are the most dependable layout tool across email clients.
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" bgcolor="#1a56db" style="border-radius:6px;">
<a href="https://example.com/trial?utm_source=newsletter&utm_medium=email&utm_campaign=trial_launch"
style="display:inline-block;padding:14px 28px;font-family:Arial,sans-serif;font-size:16px;font-weight:bold;color:#ffffff;text-decoration:none;border-radius:6px;">Start your free trial</a>
</td>
</tr>
</table>Each part has a job:
| Part | Purpose |
|---|---|
| `role="presentation"` | Tells screen readers the table is layout, not data. |
| `cellspacing="0" cellpadding="0" border="0"` | Removes default table spacing in clients that ignore CSS resets. |
| `bgcolor` on the `<td>` | The fill color as an HTML attribute, which survives where CSS background is dropped. |
| `style="border-radius:6px"` | Rounded corners where supported. Square corners elsewhere are acceptable. |
| `padding` on the `<a>` | Makes the whole rectangle clickable in clients that honor it. |
| `color` and `text-decoration:none` | White text, no underline, set inline so a client's default blue link style does not override it. |
| `&` in the URL | The correct way to write `&` inside an HTML attribute. |
The padding problem in Outlook
Outlook for Windows ignores the padding on the <a>. In that client the button shrinks to the text, and only the text is clickable. There are two common responses.
The first is to accept it. The fill color on the <td> still shows, and the link works, but the button is smaller. For many senders this is enough, because the CTA stays visible and functional.
The second is to put the padding on the <td> instead:
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" bgcolor="#1a56db" style="border-radius:6px;padding:14px 28px;">
<a href="https://example.com/trial?utm_source=newsletter&utm_medium=email&utm_campaign=trial_launch"
style="font-family:Arial,sans-serif;font-size:16px;font-weight:bold;color:#ffffff;text-decoration:none;">Start your free trial</a>
</td>
</tr>
</table>Now the size is the same everywhere. The trade-off is that the clickable area is only the text, not the whole filled rectangle. A reader who taps the edge of the colored area on a phone does nothing. This is a real cost, so test which version your audience's clients handle better before choosing.
A fully clickable button for Outlook
If your list has many Outlook desktop users and you want the whole shape clickable, use Microsoft's VML (Vector Markup Language) inside a conditional comment. Only Outlook for Windows reads the [if mso] block. Other clients see the normal link.
<!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word"
href="https://example.com/trial?utm_source=newsletter&utm_medium=email&utm_campaign=trial_launch"
style="height:48px;v-text-anchor:middle;width:220px;" arcsize="13%" stroke="f" fillcolor="#1a56db">
<w:anchorlock/>
<center style="color:#ffffff;font-family:Arial,sans-serif;font-size:16px;font-weight:bold;">Start your free trial</center>
</v:roundrect>
<![endif]-->
<!--[if !mso]><!-->
<a href="https://example.com/trial?utm_source=newsletter&utm_medium=email&utm_campaign=trial_launch"
style="display:inline-block;background-color:#1a56db;padding:14px 28px;font-family:Arial,sans-serif;font-size:16px;font-weight:bold;color:#ffffff;text-decoration:none;border-radius:6px;">Start your free trial</a>
<!--<![endif]-->This version has costs. The URL appears twice, so a change must be made in both places. The width is fixed at 220 pixels, so longer button text can overflow, and you must update the width whenever the copy changes. Use it only when the Outlook audience justifies the upkeep.
How a client decides what to show
Every path ends at the same destination. That is what "reliable" means here: the look can vary, but the action does not.
Size, contrast and tap targets
A button that renders correctly can still fail if people cannot see or press it.
- Tap target: Aim for at least 44 by 44 pixels of pressable area. Padding of 14 pixels above and below a 16 pixel font gives about 46 pixels of height.
- Text size: Use 16 pixels or larger so mobile clients do not need to zoom.
- Contrast: Keep a contrast ratio of at least 4.5:1 between text and fill. White on
#1a56dbmeets this. - Space around it: Leave empty space above and below the button so a thumb does not hit another link by mistake.
- Width on mobile: On narrow screens, a full-width or near-full-width button is easier to hit. If you use media queries for this, remember some clients ignore them, so the default layout must still work.
Dark mode
Some clients invert or adjust colors in dark mode. A button with only a light fill and default text can end up with unreadable text. Set both bgcolor and color explicitly, as in the examples, and choose a fill that still has contrast against both a white and a near-black background. A saturated mid-tone blue is safer than white or black fills.
Campaign parameters and tracking
The button URL carries the UTM parameters (utm_source, utm_medium, utm_campaign) so analytics can attribute trial starts to this email. Keep these points in mind:
- Use the same parameters on every instance of the CTA. If the button appears twice, both links point to the same URL.
- If you repeat the button, add
utm_contentonly when you want to compare positions. Otherwise leave it out so the data stays in one bucket. - Your email service provider may wrap links in its own click-tracking redirect. That is normal. Check that the final landing page URL still shows your parameters.
Check before sending
Run through this list:
- The button text matches the brief.
- The link goes to the correct landing page, with parameters, in every place it appears.
- With images blocked, the button still shows its color and text.
- In Outlook for Windows, the button is visible and the link works.
- On a phone, the button can be pressed with a thumb without zooming.
- In dark mode, the text is still readable.
- Only one distinct CTA destination appears above the footer.
Exercise
A reader opens your email in Outlook for Windows. The button shows as a small colored rectangle just around the text, and only the text is clickable. Your button has padding on the <a> element. What is happening, and what are two ways to respond?
Show answer
Outlook for Windows uses the Word rendering engine, which ignores padding on <a>. The fill from the <td> bgcolor still shows, so the button shrinks to the text. You can accept this, since the link still works, or you can move the padding to the <td> so the size is consistent (the clickable area is then only the text). A third option is a VML v:roundrect inside an [if mso] conditional comment, which makes the whole shape clickable at the cost of a duplicated URL and a fixed width.
Exercise
Your designer sends the CTA as a single PNG image with the words "Start your free trial". Give two reasons to build it as live text instead.
Show answer
With images blocked, the reader may see nothing or just a missing-image box, so the CTA disappears. Text is also easier for screen readers and easier to change for a copy test, because you edit the words instead of exporting a new image.