Created
May 6, 2013 15:10
-
-
Save elidickinson/5525752 to your computer and use it in GitHub Desktop.
Email Template trick: max-width with outlook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--[if mso]> | |
<center> | |
<table><tr><td width="580"> | |
<![endif]--> | |
<div style="max-width:580px; margin:0 auto;"> | |
<p>This text will be centered and constrained to 580 pixels even on Outlook which does not support max-width CSS</p> | |
</div> | |
<!--[if mso]> | |
</td></tr></table> | |
</center> | |
<![endif]--> |
You're the real MVP 🤗
Isn't better use table and td?
love it, thanks @elidickinson
still works after 8 years
Great solutions everyone! Although none of them can stand the normal text mixed with super long words (or just text with no spaces). Windows Mail/Outlook (2007, 2010, 365) keep stretching the table...
NB: break-all and hyphens wouldn't help since the first will break normal words, and the later will brake the links.
@philipp-klinz Great job this works perfectly to center object without center text.
If someone want to center object and text, simply use style="text-align:center;
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@people
@philipp-klinz
Thank you for THE Solution!