CSS Padding in Outlook 2007 and 2010

abcbbc發表於2011-09-15

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部落格 ” ,連結:http://blog.itpub.net/219138/viewspace-1055090/,如需轉載,請註明出處,否則將追究法律責任。

相關文章