ITPub博客

首页 > 应用开发 > IT综合 > CSS Padding in Outlook 2007 and 2010

CSS Padding in Outlook 2007 and 2010

原创 IT综合 作者:abcbbc 时间:2011-09-15 12:07:05 0 删除 编辑

For those of you who design and develop HTML emails for Outlook 2007 and 2010, you already know that you are bound by tables and you have very limited CSS support. What you might not realize is that these two email clients convert your code from something legible into a seemingly foreign Microsoft language.

今天做邮件模板,发现IE下面显示的跟outlook显示的不一样。

[@more@]

One of the more critical conversions that you should be aware of is that Outlook 2007 and 2010 will often move your CSS from div's and headings into nested paragraph and spans. Sometimes, it keeps the outer container, other times it eliminates it entirely.

For example this:


NEW FASHIONS


NEW FASHIONS


NEW FASHIONS

Will get converted to:



NEW FASHIONS






NEW FASHIONS







NEW FASHIONS



The Problem

As you can see, this conversion moved our CSS from its original box element container to an inline SPAN element and the padding was ignored.

Solutions

One work-around is to avoid padding in block element containers and use margins instead.


NEW FASHIONS

Note: I did not include the "margin" nor "margin-top" properties in this example because they are not supported by Hotmail.

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/219138/viewspace-1055090/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-09-07

  • 博文量
    56
  • 访问量
    699642