Div styles not working in Outlook Emails

拟墨画扇 提交于 2019-12-17 19:36:29

问题


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.


回答1:


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.




回答2:


I would suggest you to make basic html structure using a table tag.

You can then use "div" tags insde "td" tags.

Email templates are a pain because most of the cool stuf doesn't work :D



来源:https://stackoverflow.com/questions/27765493/div-styles-not-working-in-outlook-emails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!