HTML Email Buttons: Bulletproof Code That Works (2026)
An HTML email button that renders everywhere is a link styled inside a table cell, not a <button> element and not an image alone. This guide is for developers who hand-code templates: why web buttons break in the inbox, copy-paste code for the four main techniques (padding-based table cell, border-based link, VML for classic Outlook, image button), plus rounded corners, dark mode, accessibility, mobile, and testing. Client support data and tool features were checked in November 2026.
TL;DR
- Default choice: a table cell with a background color plus a padded
<a>inside it, withmso-padding-altfor classic Outlook. It works with images off and needs no VML. - Need rounded corners in classic Outlook: add a VML
roundrectinside an<!--[if mso]>comment. It is the only method that keeps the corners round there, but the link URL lives in two places. - Avoid image-only buttons: Litmus and Mailchimp both warn that they vanish when images are blocked. If you must use one, give it alt text that reads as the call to action.
- Accessibility minimums: 4.5:1 text contrast (16px bold labels don’t count as large text), a target of at least 44 by 44 pixels, and link text that makes sense on its own.
- Mobile: go full width with a media query, but keep the default button usable, since Gmail’s apps ignore media queries for non-Google accounts.
- No-code route: Postcards by Designmodo has button modules with radius, padding, width, borders, and a separate mobile view, from a free plan.
Why web buttons break in email
1. Classic Outlook renders with Microsoft Word. Microsoft’s documentation for Outlook 2007 says it uses Word’s HTML rendering engine and lists button, form, and input as unsupported elements, and background-image as unsupported CSS. Mailjet’s documentation notes that classic Outlook for Windows (through 2019 and classic Outlook for Microsoft 365) still uses Word, while the new Outlook and Outlook on the web use a browser-based engine. Your button has to survive both.
2. Padding on a link isn’t reliable. caniemail’s padding page gives near-universal support overall, but for Outlook for Windows 2007 to 2019 it adds two notes: padding is “only supported on table cells,” and vertical padding is buggy, with every cell in a row taking the largest value. So the padding you put on an <a> tag disappears in classic Outlook, and the button shrinks to the size of its text.

3. Images can be off. Some clients and corporate settings block images until the reader allows them. Litmus’s guide to bulletproof buttons says image buttons get lost when images are turned off and may not be readable by screen readers. Mailchimp’s guide to email buttons makes the same point.
The fix is the “bulletproof” button: live text, a link, and a table cell that carries the color. The email design system guide shows where it fits in a component library; this article goes into the code.
The four techniques at a glance
The same design tokens are used in every example below: background #1a56db, white bold Arial text at 16px with a 24px line height, 12px top and bottom padding (a 48px tall button), 24px side padding, and a 6px corner radius. White on #1a56db has a contrast ratio of 6.18:1.
| Technique | Rounded in classic Outlook | Whole area clickable | Works with images off | Main drawback |
|---|---|---|---|---|
| Padding-based table cell | No (square) | Yes, except classic Outlook (text only) | Yes | Two places to set padding |
| Border-based link | No (square) | Yes in most clients | Yes | Outlook draws the border slightly smaller |
| VML roundrect + HTML fallback | Yes | Yes | Yes | URL in two places; some ESPs don’t track the VML link |
| Image button | Shape is in the image | Yes | No, only alt text shows | Hidden when images are blocked |
Technique 1: padding-based table cell button
This is the safest default. The table cell carries the background color through both the bgcolor attribute and CSS, the link carries the padding in modern clients, and mso-padding-alt (a Microsoft Office CSS property other clients ignore) gives the cell its padding in classic Outlook.
<table role="presentation" border="0" cellpadding="0" cellspacing="0" align="center" style="margin:0 auto;">
<tr>
<td class="btn-cell" align="center" bgcolor="#1a56db"
style="background-color:#1a56db; border-radius:6px; mso-padding-alt:12px 24px;">
<a class="btn-link" href="https://example.com/pricing" target="_blank"
style="display:inline-block; padding:12px 24px; font-family:Arial, Helvetica, sans-serif;
font-size:16px; line-height:24px; font-weight:bold; color:#ffffff;
text-decoration:none; border-radius:6px;">
View pricing plans
</a>
</td>
</tr>
</table>
In modern clients the padded link makes the whole 48px button clickable, with rounded corners. In classic Outlook for Windows the link padding is ignored, mso-padding-alt pads the cell instead, the corners are square, and only the text is clickable.
Set color and text-decoration on the <a> itself, not only on the cell. Links get their own default color and underline, and a color set on the cell won’t override them.
Use it when: you want one button that works everywhere and square corners in classic Outlook are acceptable.
Technique 2: border-based button
Here the link does all the work. A thick border in the same color as the background creates the padding, so there is no padding to lose in Outlook.
<table role="presentation" border="0" cellpadding="0" cellspacing="0" align="center" style="margin:0 auto;">
<tr>
<td align="center" bgcolor="#1a56db" style="background-color:#1a56db; border-radius:6px;">
<a href="https://example.com/pricing" target="_blank"
style="display:inline-block; background-color:#1a56db; border:solid #1a56db;
border-width:12px 24px; border-radius:6px; font-family:Arial, Helvetica, sans-serif;
font-size:16px; line-height:24px; font-weight:bold; color:#ffffff;
text-decoration:none;">
View pricing plans
</a>
</td>
</tr>
</table>
Litmus lists the trade-offs of this method: all styling sits on the link, there is no VML, and the button scales with its text without fixed dimensions. On the downside, Outlook renders the borders slightly smaller, doesn’t treat the link as a block element, and shows square corners.
Use it when: you want all styling on one tag (handy when links are generated) and a slightly tighter Outlook button is fine.
Technique 3: VML roundrect for classic Outlook
VML (Vector Markup Language) is a Microsoft drawing format that the Word engine understands. caniemail’s border-radius page marks classic Outlook for Windows 2003 to 2019 as unsupported and points to VML’s roundrect element as the way to get rounded corners there. Wrap the VML in a conditional comment so only Outlook sees it, and hide the HTML button from Outlook with the reverse comment.
<div style="text-align:center;">
<!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word"
href="https://example.com/pricing" style="height:48px; v-text-anchor:middle; width:220px;"
arcsize="13%" stroke="f" fillcolor="#1a56db">
<w:anchorlock/>
<center style="color:#ffffff; font-family:Arial, Helvetica, sans-serif; font-size:16px; font-weight:bold;">
View pricing plans
</center>
</v:roundrect>
<![endif]-->
<!--[if !mso]><!-->
<a href="https://example.com/pricing" target="_blank"
style="display:inline-block; width:220px; background-color:#1a56db; padding:12px 0;
border-radius:6px; font-family:Arial, Helvetica, sans-serif; font-size:16px;
line-height:24px; font-weight:bold; color:#ffffff; text-align:center;
text-decoration:none;">
View pricing plans
</a>
<!--<![endif]-->
</div>
Details that matter:
- Fixed width. VML shapes need explicit dimensions, so long or translated labels need a wider shape.
<w:anchorlock/>andv-text-anchor:middleare part of the standard VML button pattern that Campaign Monitor’s generator outputs; the second centers the label vertically.arcsizesets the corner rounding as a percentage. Rather than calculate it by hand, generate the markup with Campaign Monitor’s buttons.cm, which caniemail links to for this purpose, and copy the value.- Two URLs. The link appears in the VML and in the HTML button. Litmus warns that you have to update both, and that some ESPs don’t track the VML link, so Outlook clicks may be missing from your reports.
Litmus is also cautious about the method’s future: it says VML adds accessibility complications and that Outlook is moving away from the older desktop clients that use VML.
Use it when: rounded corners in classic Outlook are a hard requirement and you can live with a fixed width and duplicate URLs.
Technique 4: image button with alt text
An image button is a picture inside a link. It gives full control over shape, gradients, and icons when images load.
<table role="presentation" border="0" cellpadding="0" cellspacing="0" align="center" style="margin:0 auto;">
<tr>
<td align="center">
<a href="https://example.com/pricing" target="_blank" style="text-decoration:none;">
<img src="https://example.com/images/btn-view-pricing.png" width="220" height="48"
alt="View pricing plans"
style="display:block; border:0; font-family:Arial, Helvetica, sans-serif;
font-size:16px; font-weight:bold; color:#1a56db;">
</a>
</td>
</tr>
</table>
The problem is that it depends on images. Litmus’s key takeaway is that you should never use image buttons, because they disappear when images are off and screen readers may not read text inside them. If you still need one:
- Write the alt text as the call to action itself, such as “View pricing plans,” not “button” or a file name. Postcards’ accessibility page notes that Outlook shows alt text in place of the images it blocks.
- Set
widthandheightattributes so the layout holds while the image loads. - Keep a coded button or a text link for the primary action.
Use it when: the button is decorative or secondary, never for the only call to action in the email.
Which technique should you use?
- Most emails: Technique 1, the padding-based table cell.
- Generated links or a templating system: Technique 2, border-based.
- Rounded corners required in classic Outlook: Technique 3, VML plus an HTML fallback, after checking that your ESP tracks the VML link.
- Never for the main call to action: Technique 4, image buttons.
If you are building a full template rather than a single button, the Bootstrap email templates guide has a complete table-based starter you can drop any of these buttons into.
Rounded corners and Outlook
caniemail estimates border-radius support at about 83% (last tested March 2021). The gap is mostly classic Outlook for Windows, plus Yahoo Mail and AOL, which don’t support the slash syntax for elliptical corners. You can accept square corners in classic Outlook (the right trade for most brands), use VML (Technique 3), or design square or barely rounded buttons on purpose so the Outlook version never looks broken.

The new Outlook for Windows uses a browser-based engine that renders rounded corners, according to Mailjet, so the VML fallback matters less as people move to it.
Dark mode behavior
Email clients handle dark mode in three ways, according to Litmus’s dark mode guide (client chart dated February 2025): no color change, partial invert (only light backgrounds are darkened), and full invert (light and dark colors both change). Litmus lists the Gmail app for iOS and Office 365 for Windows among the full invert clients.
Practical rules for buttons:
- Watch the edge, not just the label. White on
#1a56dbstays at 6.18:1 inside the button, but#1a56dbagainst a near-black#121212background is only 3.03:1, so the button’s outline gets weaker in dark mode. A 1px lighter border or a little extra spacing helps it stand out. - VML fills don’t invert. Litmus notes that in dark mode Office 365 inverts background colors but not VML fills, and suggests an RGBA background value as a fix so the HTML and VML versions stay in step.
- You can’t control Outlook’s text color in dark mode, per Litmus, so choose a pair that still reads if the text is reversed.
Where prefers-color-scheme is supported (caniemail estimates about 42%, with Apple Mail yes, and Gmail and classic Outlook for Windows no), you can restate the button colors and add a lighter outline for dark backgrounds:
<style>
@media (prefers-color-scheme: dark) {
.btn-cell { border: 1px solid #93b4f5 !important; }
.btn-cell, .btn-link { background-color: #1a56db !important; }
.btn-link { color: #ffffff !important; }
}
</style>
For more on how dark mode affects whole layouts, see the email newsletter design guide.
Accessibility: size, contrast, and link text
- Contrast of at least 4.5:1. WCAG 2.2 success criterion 1.4.3 requires 4.5:1 for normal text and 3:1 for large text. Large text means at least 18pt (about 24px), or 14pt bold (about 18.5px). A 16px bold label is below that, so it needs the full 4.5:1. For reference, Bootstrap 5.3’s
$blue(#0d6efd) with white text measures 4.50:1, right on the line, while#1a56dbmeasures 6.18:1 and#3b82f6only 3.68:1. - Target size of at least 44 by 44 pixels. WCAG 2.2’s minimum (2.5.8, Level AA) is 24 by 24 CSS pixels, and the enhanced criterion (2.5.5, Level AAA) is 44 by 44. The 48px tall examples in this guide meet the enhanced size.
- Descriptive link text. WCAG 2.4.4 (Level A) asks that a link’s purpose be clear from its text or its context. “View pricing plans” works; “Click here” doesn’t. Litmus suggests one to five words is usually enough.
role="presentation"on layout tables. It stops screen readers announcing rows and columns around the button. caniemail estimates support for theroleattribute at about 73% (last tested February 2020).langon the<html>element. It lets screen readers pronounce the label in the right language. caniemail estimateslangsupport at about 80% (last tested October 2020); Yahoo Mail and AOL don’t support it on<td>elements.
Full-width buttons on mobile
On phones, a full-width button is easier to tap. Add classes to the button table and link, then widen them in a media query in the <head>:
<style>
@media only screen and (max-width: 600px) {
.btn-table { width: 100% !important; }
.btn-link {
display: block !important;
width: auto !important;
text-align: center !important;
}
}
</style>
<!-- In the body -->
<table class="btn-table" role="presentation" border="0" cellpadding="0" cellspacing="0" align="center" style="margin:0 auto;">
<tr>
<td class="btn-cell" align="center" bgcolor="#1a56db"
style="background-color:#1a56db; border-radius:6px; mso-padding-alt:12px 24px;">
<a class="btn-link" href="https://example.com/pricing" target="_blank"
style="display:inline-block; padding:12px 24px; font-family:Arial, Helvetica, sans-serif;
font-size:16px; line-height:24px; font-weight:bold; color:#ffffff;
text-decoration:none; border-radius:6px;">
View pricing plans
</a>
</td>
</tr>
</table>
Make the link display:block too, or the colored area stretches while the clickable area stays the size of the text.
caniemail estimates @media support at about 80% (last tested December 2023), with caveats: Gmail doesn’t support nested or height-based queries, Gmail’s mobile apps don’t apply media queries for non-Google accounts, and Yahoo Mail only supports screen, min-width, max-width, min-height, and max-height. Treat the full-width version as an enhancement and make sure the default button is already at least 44px tall. The responsive email templates for Gmail guide covers the full responsive layout around it.
Building buttons without code in Postcards

If you’d rather not maintain button code, Postcards by Designmodo is a drag-and-drop email builder with button modules. Its help center documents these settings:
- Three button types: a single button, two buttons side by side, and a wide button that fills 100% of its container.
- Corner radius from 0 (square) upward, set for all corners at once or each corner separately.
- Padding, margins, and width (auto, or a fixed value in pixels or percent).
- Mobile view: settings changed in mobile view override desktop, and a button can be hidden on mobile or on desktop.
- Background color, borders (each side separately), font settings, an optional icon, and shadows (with a note that support is limited in Outlook and Gmail).
- Save as a module, so a styled button can be reused across emails.
Brand presets store styles for text, buttons, and colors, and are included on every plan, including the free one. Postcards’ accessibility checks flag buttons with no link, text too pale or under 14px, and images missing alt text, and paid plans add email client previews in Gmail, Outlook, Apple Mail, and Yahoo.
Pricing. The free Start plan includes 10 template projects and 5 exports a month. Plus is $19 a month ($16 a month billed yearly) with 20 exports a month and 20 email client previews. Pro is $29 a month ($24 billed yearly) with unlimited exports and 50 client previews. Extra editors are $8 each.
Limitations. Postcards’ button documentation doesn’t mention VML output, so plan on square corners in classic Outlook unless your own preview shows otherwise. It also doesn’t document dark mode or alt and aria settings for buttons. Client previews aren’t on the free plan. For other builders, see the best email template builders.
Test your buttons before sending
Check these before every send:
- Classic Outlook for Windows: padding, centering, and the VML URL and size.
- New Outlook, Outlook.com, Gmail, Apple Mail, Yahoo: corners, colors, and full width on mobile.
- Images off: every call to action is still visible and readable.
- Dark mode: in a partial invert and a full invert client, not only Apple Mail.
- Clicks: tap the whole button area, and confirm your ESP tracks both HTML and VML links.
Litmus offers previews in 100+ email clients including dark mode. Unspam renders previews across 60+ real clients and devices including dark mode, and its free plan includes 3 device previews a month (one preview is one render on one device). The roundup of the best email testing tools compares the options.
FAQ
What is a bulletproof button in email?
A call-to-action built with HTML and CSS instead of an image, so it displays when images are blocked. It usually combines a colored table cell and a styled link, sometimes with a VML version for classic Outlook.
Why doesn’t my email button have padding in Outlook?
Classic Outlook for Windows renders HTML with Microsoft Word, and caniemail notes that it supports padding only on table cells. Padding on an <a> tag is ignored, so put the padding on the <td> as well, or use mso-padding-alt on the cell.
Can I use the HTML button element in emails?
No. Microsoft lists button, form, and input as unsupported in Outlook’s Word rendering engine, and a <button> isn’t a link, so it has no URL to open. Use a styled <a> link inside a table cell instead.
How do I make rounded buttons work in Outlook?
Classic Outlook for Windows doesn’t support border-radius. Use a VML roundrect inside an <!--[if mso]> comment, with a normal HTML button for other clients. buttons.cm generates the VML code.
How big should an email button be?
Aim for at least 44 by 44 pixels, the WCAG 2.2 enhanced target size, with a label of 16px or larger and a contrast ratio of at least 4.5:1. On mobile, a full-width button is easier to tap.
Build your Bootstrap theme
Design a custom Bootstrap 5 theme visually with a live preview, then export clean Sass or CSS.
Open the Builder