覆盖胸甲层的Gmail字体

发布于 2025-01-24 14:06:49 字数 682 浏览 2 评论 0原文

我想使用Thymeleaf和我的自定义字体(Google字体)覆盖Gmail默认字体,但我尝试了这些,但没有可行的方法:

1,使用内部CSS

<style>
@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,300;0,700;1,900&display=swap');
p,pre {
        font-family: 'Nunito', sans-serif;
      }
</style>

2,使用Inline CSS使用Inline CSS,

<style>
@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,300;0,700;1,900&display=swap');
</style>

<p class="mail-body-greeting" th:text="#{email.activation.greeting(${user.firstName})}" style="font-family: 'Nunito', sans-serif;">Dear John</p>

我是否缺少某些内容?

I want to override Gmail default font using Thymeleaf with my custom font (a google font) and I tried these but none works:

1, using internal CSS

<style>
@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,300;0,700;1,900&display=swap');
p,pre {
        font-family: 'Nunito', sans-serif;
      }
</style>

2, using inline CSS

<style>
@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,300;0,700;1,900&display=swap');
</style>

<p class="mail-body-greeting" th:text="#{email.activation.greeting(${user.firstName})}" style="font-family: 'Nunito', sans-serif;">Dear John</p>

Am I missing something?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文