I am building a button, using vml because it's the only way to make it rounded on Outlook emails. I need its width to depend on its content. However I can't find a way to do so. The only width I am able to give it is a fixed width.
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word"
style="width:200px; height:41px; v-text-anchor:middle;"
arcsize="10%"
stroke="f"
fillcolor="#d62828">
<w:anchorlock/>
<center style="color:#ffffff;font-family:sans-serif;font-size:16px;font-weight:bold;">
Découvrir
</center>
</v:roundrect>
Is it possible to make its width depend on its content width? And if not, is it possible to make it equal to 100% of its parent (I tried mso-width-percent but it depends on the viewport width, not the parent width)?
I know this is old, but in case someone is still trying to figure this out, I was able to get the <v:roundrect> to expand to the size of the text with the following:
style="mso-wrap-style:none; mso-fit-shape-to-text: true;"
The problem was that it was wrapping on words causing it to look like it wasn't expanding correctly. This resolves that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With