MaxwellLynn
MaxwellLynn

Reputation: 968

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

Upvotes: 7

Views: 20000

Answers (4)

Alex W
Alex W

Reputation: 38233

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.

Upvotes: 1

elizur424
elizur424

Reputation: 75

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

Upvotes: 1

John
John

Reputation: 12193

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.

Upvotes: 3

Nick Andriopoulos
Nick Andriopoulos

Reputation: 10643

You can add inline styles, that override Outlook's defaults (they have higher precedence).

Eg.

<div style="padding:0; margin:0;" class="wrapper">
  ... etc ...
</div>

Upvotes: 0

Related Questions