问题
I'm programmatically sending HTML-formatted email, and setting the font as Arial throughout (font-family: Arial;
). When the messages arrive in Outlook 2010, text in table
elements is in Times New Roman. Text in div
elements is fine in Arial. If I View Source
, copy into an HTML file, and view in a browser, all fonts function as expected (it's all Arial).
Some Google results show that Outlook will fall back to its default font (Times New Roman) when none is specified, but that's not what's happening here.
Why is Outlook forcing my email to display in Times New Roman when specified otherwise?
回答1:
Even if you set font-family: arial
to table, it still wont work. You need to specifically set the font for each td
inside your table
to get it right.
回答2:
<!--[if mso]>
<style> body,table tr,table td,a, span,table.MsoNormalTable { font-family:Arial, Helvetica, sans-serif !important; }</style>
<!--<![endif]-->
回答3:
The table
in question was nested in a div
that had font-family:Arial;
in its style, but the table
did not have a font set. So tables don't inherit fonts (and perhaps other things) from their containers in HTML emails in some clients.
回答4:
This issue was happening from outlook 2007 and the previous solutions didn't work for me, the only solution that seems to work is wrapping the text with <font face="arial, sans-serif">My text with arial</font>
回答5:
If you're working with Outlook 2007, you must define font-family on table . Otherwise it will set to default serif font.
回答6:
The <font> tag is deprecated but since Outlook 2010 is removing (almost all) styles, this is the only way it works.
回答7:
table.MsoNormalTable
{font-size:12.0pt;
font-family:"Times New Roman";}
Open your HTML with Text Pad, and change it to Arial.
回答8:
None of above methods worked for me, using a custom font linked with @font-face. had to work with conditional tags for Outlook. Took me quite some time to figure out how exactly. So I've set up a code example: I was still having some troubles implementing this in my situation so I've shared a code example for this: https://stackoverflow.com/a/21626196/135654
回答9:
You can put your style to "span" tag, It will works good.
<td>
<span style="font-family: "Times New Roman"></span>
</td>
回答10:
I had the same problem....all text in the body of the email was Arial, but the table defaulted to word. I had to wrap the font in each each cell......time consuming..
来源:https://stackoverflow.com/questions/10457006/outlook-2010-overriding-font-family-from-arial-to-times-new-roman