我正在使用 PHPMailer 发送邮件,Gmail 似乎无法识别标题中的字体“Kaushan Script”,但它成功识别了正文其余部分的“Roboto Condensed”。两者都是谷歌字体。尽管如此,gmail 还是能够识别一个并忽略另一个并放置它自己的随机字体。检查 gmail 中的元素仍然显示我使用的字体名称。这是我的代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/css2?family=Roboto+Condensed&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Kaushan+Script&display=swap" rel="stylesheet">
<style>
.mail-head, .mail-foot {
background: linear-gradient(315deg, #ee9617 0%, #fe5858 74%);
padding: 10px;
width: 100%;
box-sizing: border-box;
color: #fff;
font-size: 2rem;
font-family: "Kaushan Script", cursive;
}
.mail-foot {
font-size: 14px;
text-align: center;
font-family: "Roboto Condensed", sans-serif;
}
.mail-body {
font-size: 1rem;
font-family: "Roboto Condensed", sans-serif;
padding: 20px;
line-height: 1.5;
border-right: 1px solid #ee9617;
border-left: 1px solid #fe5858;
}
.logo {
width: auto;
height: 2.5rem;
}
.logo-title {
position: absolute;
top: 1rem;
left: 4.5rem;
}
.otp {
color: #f69;
margin-left: 10px;
}
</style>
</head>
<body>
<div class="mail-head">
<span class="logo-title">Site Name</span>
</div>
偶然的你