Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rich HTML emails in Outlook 2007 and 2010... how do you remove the top margin?

I have a rich HTML email. I was wondering how, in Outlook 2010 and 2007, you get the table in the layout to sit flush with the edge of the browser?

Have a look at this pic:

enter image description here

The pink is the background color of the body tag and the grey is the bg of the table. They both have 0 everything (margin, paddting ect). But there is still some space. The pink should not be visible.

Does anyone know how to get rid of this space on the body?

Also here’s some CSS for the start of the email:

<html>
<head>

    <style type="text/css">
        html, body{ width:100%; }
        body{ background-color:#ff00ff; }
    </style>

   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   <title>Test</title>
</head>
  <body topmargin="0" style="margin:0; padding:0; width:100%; background-color:#ff00ff;" >
            <table topmargin="0" align="center" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;border-spacing: 0;border: 0; margin:0; padding:0; background-color:#eee;" >

Cheers!

like image 867
MintDeparture Avatar asked Apr 03 '11 23:04

MintDeparture


People also ask

How do I get rid of margins in Outlook?

On the Format tab, click the Expander icon to open the Paragraph dialog. (If the ruler is visible, you can point to the indentation triangles and double click to open the dialog instead.) The Left and Right Indentations should be set to zero.

How do I fix the margins in my email?

If you want to adjust the margins, you do it the same way you would set the margins in Word, by dragging the triangles on the Ruler edges. If the Ruler is not visible, click the ruler toggle at the top of the scrollbar (1) then drag the triangles inward a little.

How do I change the default margins in Outlook?

Click PAGE LAYOUT > Margins. At the bottom, click Custom Margins. In the Page Setup box, enter new values for the margins. Click the Set As Default button.

How do I view all HTML emails in Outlook?

How do I view the HTML in Outlook? In Microsoft Outlook, double-click to open an email. You'll see an “Actions” menu under the “Message” tab. Click on that menu and select the “Other Actions,” then click on “View Source” to see the HTML code.


2 Answers

Outlook 2007/2010 adds 15px top/bottom and 10px left/right body padding to all html emails. You can't get rid of it.

Here's a trick to fake full backgrounds: http://www.campaignmonitor.com/forums/viewtopic.php?pid=17048

like image 52
Jeff Miller Avatar answered Nov 15 '22 22:11

Jeff Miller


Outlook uses the broken Microsoft Word HTML engine and is not based on any reasonable resemblance to a browser.

If you have Word, you can at least open your email as html and see how it renders it without having to go through the whole mail cycle.

Outlook really in the bane of any email marketer. It is an absolute pile of crap and fails to support even the most basic CSS expectations.

I'd have to have many frank and disappointing discussions with graphic designers over the limitations of email as a platform due to Outlook. Microsoft has seriously made a step backwards in using the Word engine for Outlook.

like image 31
Diodeus - James MacFarlane Avatar answered Nov 15 '22 21:11

Diodeus - James MacFarlane