0

I have a minor question:

Im doing a email that is being sent out and wish to have no margin at the top of the email - so that a image or table is flush with the top of the viewport.

I have tried sticking body tags in the html email with margin-top: 0px and it works fine in Thunderbird. However when testing in Microsoft Outlook there is a margin top applied to the content. Is there any way to get rid of this margin or is it not possible in Outlook.

bkaid
  • 51,465
  • 22
  • 112
  • 128
Jobfad
  • 11
  • 1
  • 1
  • 1
  • Have you tried setting padding to 0 as well? – Pekka Dec 01 '09 at 10:22
  • 2
    You cannot use CSS for layout in Outlook 2007. More ire: http://www.campaignmonitor.com/blog/pos ... in-emai-2/ – Fionnuala Dec 01 '09 at 12:01
  • Unfortunately you can't. Check out Jeff Miller's response here: http://stackoverflow.com/questions/5533240/rich-html-emails-in-outlook-2007-and-2010-how-do-you-remove-the-top-margin – Nelga Apr 17 '12 at 07:21

3 Answers3

3

You need to add the following to the <body> tag.

<body topmargin="0">

Ultimately though Outlook is poor at rendering CSS and it's going to get worse with 2010 unfortunately. In the mean time, in-line styles are really the only styles that will work in the majority of cases.

Jeepstone
  • 2,591
  • 5
  • 22
  • 38
  • Can you post/link your HTML/CSS? I don't normally get space at the top in Outlook so must be something fixable. – Jeepstone Dec 02 '09 at 08:12
2

Outlook is the bane of HTML emails everywhere.

Check out this discussion for some answers and tips.

Bottom line: code like it's 1998. Tables all over the place. Don't nest tables either, as that often causes problems. No external styles, so learn to love your inline style attributes.

Ugh, just thinking about it gives me a tummyache.

Community
  • 1
  • 1
Scott
  • 2,753
  • 1
  • 24
  • 31
0

Maybe you could try to insert some css that overrules the body? Something like this:

*{
  margin: 0px;
  padding: 0px;
}
Bloeper
  • 347
  • 2
  • 3
  • 13