MailViewr - Free HTML Email Preview Tool
← CSS Support Index

Does CSS margin Work in HTML Email?

Support for the `margin` shorthand property and the `margin-left`, `margin-right`, `margin-top`, `margin-bottom` properties.

Quick Answer

Does margin work in HTML email?

The CSS margin property is supported in all major email clients tested. You can use it with confidence in your HTML emails.

Which Email Clients Support CSS margin?

CSS support for margin across email clients

Email ClientDesktopMobile / WebNotes
Gmail~ Partial~ Partial
Outlook (Windows)~ Partial?
Outlook (Mac / Web)✓ Yes~ Partial
Apple Mail✓ Yes✓ Yes
Yahoo! Mail~ Partial~ Partial
Samsung Email?✓ Yes
Thunderbird✓ Yes?
ProtonMail✓ Yes✓ Yes
Fastmail✓ Yes?

Notes

  • #1 Partial. Negative values are not supported.
  • #2 Partial. Not supported on `<span>` and `<body>` elements.
  • #3 Buggy. `background-color` is included inside the `margin`.
  • #4 Partial. `auto` value is not supported.

Frequently Asked Questions

Related CSS Properties

Test Your Email Now

Paste your HTML and see how it renders in clients that don't support
margin.

Open Email Previewer