Skip to content

Instantly share code, notes, and snippets.

@Chapoton
Last active September 23, 2022 17:23
Show Gist options
  • Save Chapoton/f091ee6314817b32076576177983b0b4 to your computer and use it in GitHub Desktop.
Save Chapoton/f091ee6314817b32076576177983b0b4 to your computer and use it in GitHub Desktop.
HTML email button. I use this in MailChimp emails because their default email buttons are only clickable on the text, not the entire button.
<!-- Paste this into the code block of a HTML email. -->
<table align="center" border="0" cellpadding="0" cellspacing="0" width="600" style="border-collapse: collapse;mso-table-lspace: 0pt;mso-table-rspace: 0pt;table-layout: fixed;margin 0px auto;width:100%;">
<tbody>
<tr>
<td align="center">
<style type="text/css">
.btn a {
display: inline-block;
background-color: #00add2;
border-width: 10px 20px;
border-style: solid;
border-radius: 4px;
border-color: #00add2;
font-family: Lato, 'Source Sans Pro', Arial, sans-serif;
font-size: 16px;
font-weight: bold;
color: #ffffff;
letter-spacing: 2px;
text-decoration: none;
line-height: 30px;
text-align: center;
transition: all 0.2s ease-in;
}
.btn a:hover,
* [lang=x-btn] a:hover {
background-color: #00bee7 !important;
border-color: #00bee7 !important;
}
</style>
<div class="btn" lang="x-btn">
<a href="#">Register now!</a>
</div>
</td>
</tr>
</tbody>
</table>
@webster-mcwebby
Copy link

Very helpful! I made my own adjustments and it looks good. I will have to test it out but fingers crossed!

@Chapoton
Copy link
Author

Glad to hear it! I'm amazed this is still relevant and necessary. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment