Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Div styles not working in Outlook Emails

I have created a HTML template for Emails using Div tags.

Its working fine on Gmail, Yahoo.

But Div styles not working in the Outlook.

Following is the code which i have used.

<div style="margin:auto;padding:auto;background-color:#FFFFFF;width:600px;border:0px;">
Testing Email
</div>

I have set div width 600px also make margin and padding auto. so that it will display in the center of the screen.

But its not working like that.

Gmail, Yahoo display email in the center of the screen

Please suggest how can i reslove this issue.

like image 944
Sunny Patial Avatar asked Jan 04 '15 12:01

Sunny Patial


2 Answers

Here's the DIV properties compatibility table (taken from www.campaignmonitor.com, see LiamB answer):

Client                  Float   Position  Margin  Width
Outlook 2003 / Express  Yes     Yes       Yes     Yes
Windows Live Hotmail    Yes     No        Yes     Yes
Yahoo! Mail             Yes     No        Yes     Yes
Outlook 2007 / 2010     No      No        Yes     No
iPhone                  Yes     Yes       Yes     Yes
Gmail                   Yes     No        Yes     Yes
Apple Mail 4            Yes     Yes       Yes     Yes
Lotus Notes 6.5 & 7     No      No        No      No
like image 184
Niente0 Avatar answered Sep 30 '22 17:09

Niente0


Float width and position CSS styles applied to div's do not work in Outlook.

  • Link Now Dead - https://www.campaignmonitor.com/blog/post/3472/div-tags-in-html-email-newsletters/ (See table half way down)

This is the primary reason while Tables are still used so heavily in Emails.

like image 34
LiamB Avatar answered Sep 30 '22 17:09

LiamB