Suppose you have a website and your site visitors sign up for your newsletter. You send out the newsletter periodically. You write the HTML markup of the newsletter by yourself. Your newsletter is rendered fine in some email clients but rendered strangely in others. This article is about this use case.
What's your markup like?
Suppose you want to insert a 10px line spacing between two lines of text. Does your HTML markup look something like the following?
<div style='padding:10px'></div>
If so, Hotmail would automatically insert a space inside the empty <div> tag so it looks like this when rendered in Hotmail's online email interface (i.e. when your subscriber signs into his Hotmail email at hotmail.com):
<div style='padding:10px'> </div>
To see the HTML source code of your rendered email, use a web developer tool such as Chrome.
However this is not what you want because it makes the vertical spacing much larger. It doesn't break the layout; it just makes your HTML email look unnatural. In fact Hotmail does a lot of things to modify your original HTML markup before it's delivered for many reasons. Read on to find an easy solution to change the spacing between lines or paragraphs in your HTML emails.
Solution
Instead of using "padding:10px" you simply use the following:
<div style='height:10px'></div>
Problem solved. This CSS style also works for Yahoo and Gmail, which is good enough for me as far as coverage is concerned. You can never cover every single email client in the world; so why not just cover the biggest ones like Gmail, Yahoo, and Hotmail?
Questions? Let me know!