Outlook 2007 losing font-family declaration
Email clients are one of the pinnacle frustrations for web designers. The limitations are far greater than those of web browsers and you can always count on Microsoft’s Outlook 2007 being at the forefront of compatibility problems and bug issues. If you create emails that have to support Outlook 2007’s wonky Word rendering you may have noticed on occasion that your specified font-family disappears. There’s a few ways to fix this, but some are better than others.
Keeping code clean in the messy world of email newsletters
Obviously putting the font-family in the table or a surrounding div should do the trick, and it does for everything except Outlook 2007, for some reasons font-family declarations do not cascade. One easy but tedious way to fix this issue is to put inline styles all over the place. I don’t like this method, it makes it easy to forget sections of copy and it messy. I always especially avoid using inline styles on paragraph tags. You have have almost no control on the p tags anyway. Put everything you need in your td tags and leave your p tags clean.
So you might be thinking well then I’ll just add font-family declarations to all my td tags. Again this is slightly less messy, but still messy and our newsletters markup are awfully messy as it is. This is a place where you can use an embedded style. I know there are blanket rules like never user anything but inline styles, but this is not always the case, and blanket rules never benefit anyone. There are places for embedded styles, and they are even required in some cases for optimal cross client compatibility as I wrote about in “Outlook 2007, inline styles, and links“. The thing you must always remember when using embedded styles is that other email clients like Gmail are going to ignore them completely, so build in redundancies.
Style the table data
The fix is simple, you only need to declare your font-family twice. Use an inline style once in your table.
<table border="0" cellspacing="0" cellpadding="0" style="font-family:font-family:Verdana, Geneva, sans-serif;">
At the top of your page add this to your embedded style.
<style media="all" type="text/css"> td { font-family:Verdana, Geneva, sans-serif; } </style>
Now you have made Outlook 2007 happy and given every td in your email newsletter a font-family. When the embedded style is stripped in other clients like Gmail you are still keeping the client happy, because other clients won’t ignore the font-family in the table tag and it will actually cascade throughout the document.
AJ November 18, 2010 at 2:50 pm
Wow this helped me a lot – one thing though, in your sample you wrote “font-family” twice – so it won’t work for people just cutting and pasting.
again, thanks!
Ian Hoar November 18, 2010 at 3:24 pm
Thanks for the catch, it’s fixed now.
James February 20, 2015 at 10:46 am
Actually it’s not :p The inline code example.
Nick Frost September 28, 2011 at 10:06 am
Thanks for the tip. Was looking for a fix to outlook showing times new roman for a newsletter i’m working on – and i’m pretty sure this is it.
Marie April 25, 2012 at 9:09 pm
It didn’t work for me at all… Still Times new roman everywhere…
filippo September 20, 2012 at 9:17 am
same here. not working
but thanks
John Vorwerk November 16, 2012 at 9:11 am
Hi,
we are trying to fight exactly the same problem in our Emlun newsletter software. The problem is also that almost any program, including most web-based HTML Editors and Microsoft Expression, will assume Arial to be the default font.
Outlook appears to be the only program that appears to be glued to Times New Roman (who uses that font, anyway?).
Always my best,
John