Preview your email in the most popular email clients and mobile devices.    Try it for FREE!

Outlook.com Margin-alizes CSS Properties

Posted January 21, 2013 by Geoff Phillips

Email Testing RSS Feed Email Test on Twitter Email Preview on Digg Email CSS on Linked In Email Simulator on Stumbled Upon

Outlook.com and Hotmail Allow No Margins (for Error)

It's always a challenge to create emails that will look good in every client, and it may have just gotten a little bit harder. Outlook.com has discontinued support for:

margin
margin-top
margin-right
margin-bottom
margin-left

In the past, Outlook.com has not supported the margin and margin-top properties, but discontinuing all margins is new.

Enforced Styles

Hotmail and Outlook.com enforce their own embedded styles on headings and paragraphs. Then they proceed to strip yours out. Hotmail's enforced attributes look like this:

<style>
h1, h2, h3, h4, h5, h6 {
 margin: 0 0 5px 0;
}
 
p {
 margin: 0 0 1.35em 0;
}
</style>

The email client srips every instance of the margin property (server side), so unfortunately this issue plagues all web browsers.

Working Without Margins

Though it will never work in quite the same way as margin, the padding property can be used in many places where margin would have been ideal. Just remember that padding goes inside the border of an HTML element, whereas margin goes outside the border. If you find another work-around or a fix, please let us know in the comments down below!

Comments

Alex pic
Alex
If you use a span tag instead of a p tag and set margin-top:#; margin-bottom:#; this will resolve it.
Posted 01/24/2013

Jeff pic
Jeff
It's not just the margin properties. From what I can tell, float is out too, as is the img align attribute.
Posted 01/24/2013

AWE pic
AWE
Anyone have an issue with the margins when just writing or receiving emails. It doesn't happen with all emails.

Some of my emails I send to friends are received with what seems like a negative left margin. Parts of words and letters are cut off.

This also happens with some emails I receive. The margin seems to be negative value.
Posted 05/08/2013

Ryan pic
Ryan
Re: Alex - you can use span, but it won't display as a block level element in Outlook 2007/10/13. (see http://stackoverflow.com/questions/8989161/how-do-i-get-ms-outlook-to-accept-the-css-style-displayblock)

If the default margins are breaking your stuff your best bet is nested tables unfortunately. Outlook is so bad it hurts
Posted 07/19/2013

rose pic
rose
I created a hr in my email, and want make it align to left, i use
style="text-align:left;margin-left:0", all browser are working instead of hotmail.

I am really down of it.
Man!
Rose
Posted 10/11/2013

Paul pic
Paul
Problem is - if you use large font sizes on paragraphs to get the appearance of a heading - something I've done in the past to avoid issues with heading tags in Hotmail, then you get proportionally huge bottom margins. Fortunately outlook.com no longer seems to make headings green!
Posted 11/06/2013

Comment via our Blog

Name:
Email:
Location:
URL:

Comment:

Remember my personal information
Notify me of follow-up comments?

Please enter the word you see in the image below:

x
Sign up for our Newsletter

And get updates on the latest email tips, tricks and hacks!