Outlook 2010 not respecting CSS, even tags for every text

前端 未结 1 423
说谎
说谎 2021-01-13 18:55

We need our emails to look good on machines that have Helvetic Neue. So our font stack is:

font-family: \'Helvetica Neue\',HelveticaNeue,Helvetica,Arial,san         


        
相关标签:
1条回答
  • 2021-01-13 19:50

    This will solve your problem:

    <style type="text/css">
        table { border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;}
        table td {border-collapse: collapse;}
    </style>
    <!--[if gte mso 9]>
        <style>.outlook { font-family: arial, sans-serif; }</style>
    <![endif]-->
    </head>
    <body>
    
        <table align="center" width="95%" cellpadding="8" cellspacing="8">
            <tr>
                <td class="hide-on-small" align="center" valign="middle" style="border-top: 1px solid #ffffdffffd;border-bottom: 1px solid #ffffdffffd;font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; color: #999999;">
                    <span class="outlook">Rummy & Bingo Monthly</span>
            </td>
            </tr>
        </table>
    </body>
    
    • I removed the unnecessary reiterations of your font-style declaration. There's no need to declare it anywhere other than the TD.
    • I moved your font-style declaration from the span to the TD along with your CSS class assignment of "hide-on-small".

    The font-style was separated from the specifically to fix your Outlook problem. - In the head, below any other CSS you may have declared, I added a conditional comment which will only be read by Outlook. Within this comment is a CSS class which will tell outlook that the font is Arial. Therefore Outlook will completely ignore the fact that your using a font that isn't available, thus negating any reason for it to find its own substitution.

    Also, pulled out your inline CSS border-collapse declaration because you can just declare that in the head and in the body, give all your tables an attribute of border="0". Instead of writing style="border-collapse:none;" a dozen or more times.

    0 讨论(0)
提交回复
热议问题