Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove default padding/margin from around the email view of outlook for HTML emails

I'm having some trouble finding away to remove the padding or margin default values from around my html email in most versions of outlook. I was wondering if there is something that I can put into my HTML email to prevent the padding/margin from showing.

Thanks

like image 978
MaxwellLynn Avatar asked Mar 22 '13 10:03

MaxwellLynn


People also ask

How do I remove default margin and padding in HTML?

The right answer for this question is "css reset". It removes all default margin and padding for every object on the page, no holds barred, regardless of browser.

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 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 turn off auto margin in HTML?

This margin is automatically created by some browsers to allow for space between the edges of the viewport and the website content. You can remove this margin by setting the top and left margin to zero.


2 Answers

This works:

<body style="margin: 0px; padding: 0px; background-color: #252525" bgcolor="#252525">

Just note whatever you set the body background color to will bleed into the email chain if it is forwarded. I'd suggest leaving the body white and setting the color on a html container table to prevent this.

like image 191
John Avatar answered Oct 07 '22 18:10

John


Also if you need for your table cells to be completely flat without padding and empty make sure to add this to the table:

    <table cellpadding="0" cellspacing="0">

And in the case of the empty cells

    <td style="font-size:0px;">
like image 45
elizur424 Avatar answered Oct 07 '22 16:10

elizur424