简体   繁体   中英

@font-face don't works just inline font-family

I need your help, I'm trying to change the font for an email in PHPMAILER, and just recognize the inline css, style tag in the head dont works (I don't know why).

You know how can I do for insert the @font-face inline the tbody?

$contenido = '<!doctype html>
    <html>
      <head>
        <style>
    @font-face {
        font-family: dinot-regularregular;
        src: url(xxxxxxxxxxxx/css/Font/dinot-regular-webfont.woff);
    }
    body {
        font-family: dinot-regularregular;
    }
        </style>
      </head>

    <body>';
$contenido .= '
<table> 
<tbody style="font-family:dinot-regularregular; font-size:16px; color:#666666;">
// Content
</tbody>
</table>';

Thanks for your help.

Formatted emails are very finicky with support from email clients. If you read this article they have a table showing how many email clients support font-face. It's not a very high number.

https://www.campaignmonitor.com/blog/post/3044/does-font-face-work-in-email

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM