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

17,372

Solution 1

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.

Solution 2

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;">

Solution 3

Try using the CSS reset from the HTML Boilerplate:

body{width:100% !important; -webkit-text-size-adjust:100%; -ms-text-size-adjust:100%; margin:0; padding:0;}
.ExternalClass {width:100%;}

Or better yet, just use the Boilerplate as the starting point for your e-mails.

Share:
17,372
MaxwellLynn
Author by

MaxwellLynn

Front end web developer working in Bristol as well as freelance on the side.

Updated on July 03, 2022

Comments

  • MaxwellLynn
    MaxwellLynn almost 2 years

    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