All Mail clients render HTML/CSS differently, in their own ways and for their own reasons. The differences in what HTML and CSS they support depends on many factors. When rendering HTML and CSS in emails many things impact what the end user is going to see. The mail exchange server, the preprocessor, the browsers, the rendering engines, and more; all affect the way your message is going to be displayed. These vary from client to client; browser to browser; server to server. However, don't start pulling your hair out just yet, because there are some best practices you can utilize so that your emails' coding will stay intact across different clients and platforms.
Avoid using padding or margins
Always use inline CSS
Most webmail clients (Outlook.com, Yahoo.com, Gmail, etc) will strip CSS out when stripping the head and body tags.
Avoid BR, HR, and height tags in your emails
Use Tables to create general layout of email
Set wrapper reset styles in "wrapper div"
Be aware of text and font changes per device (mobile especially) and browsers
Use the older more basic background HTML tags
Always provide image dimensions
Some mail clients will automatically apply their own if none are given which can lead to major issues when rendering these images in relation to spacing and alignment.
Outlook.com adds some pixels at the end of each image which can rearrange spacing, alignment, or padding
img {display:block;}
. This removes the padding in outlook.com and gives predictable results across many other email clients in terms of added spacing or padding to images.
Avoid 'float' tags
<img src="image.jpeg" align="right">
.
Due to low usage, this feature has been removed. Click here for more information.
To control the output of plain-text conversion do one of the following:
<pre>
tag around the line.
<p>
tag around the sentence.
Why can't you just automatically add <br />
tags to newlines upon conversion?
Due to the way plain text emails are sent ( RFC 5822, Revised 2008) mailers are required to wrap lines at 998 characters, and recommends wrapping at 78 characters (excluding CR/LF). As a result, long sentences can often be broken up into multiple lines. Adding <br />
tags to each newline would create formatting problems.
For more information
We use the open-source library MKDoc-Text-Structured to perform the plain-text to HTML conversion. More information about this library and how it works can be found on the MKDoc-Text-Structured documentation page.
If you're still having issues, please contact our support team for help. We can provide the tools and the knowledge base to help you understand what your mail will look like across platforms and how to gain insight in making them appear consistent across these platforms.