Last active
September 9, 2024 10:44
-
-
Save elidickinson/9424116 to your computer and use it in GitHub Desktop.
HTML email buttons that work
Everyone that asked how to center the button, just wrap it in a <center>
tag. I tried to horizontally align the v:roundrect
with the o:hralign="center"
attribute (along with anything else that I could find or made sense) but nothing really works. Best to just center the outer tag and the text with simple <center>
tags:
<center>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="https://www.example.com" style="height: 45px; v-text-anchor: middle; width: 300px;" arcsize="10%" stroke="f" fillcolor="#6699ff">
<w:anchorlock/>
<center style="color: #ffffff; font-family: sans-serif; font-size: 15px;">
Text
</center>
</v:roundrect>
</center>
what if I don't want stroke="f", why is there no documentation on the internet about this? microsoft devs should be tortured daily
The link seems to not work sometimes in Outlook. Will this convert it to an image in some cases - like forwarding it?
Edit: I've added another normal anchor tag around the <v:roundrect> element and seems to work.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey i got an issue with the code, the roundrect was overlapping the text. Can anyone give me some guides, appreciate with thanks.
<!--[if mso]> <v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" style="height:36px;v-text-anchor:middle;width:350px;position:absolute; top:280; left:310;" arcsize="5%" strokecolor="#EB7035" fillcolor="#EB7035"> <w:anchorlock/> <center style="color:#ffffff;font-family: sans-serif; letter-spacing: 1px; font-size:16px;">My Text!</center> </v:roundrect> <![endif]-->