【问题标题】:Amp for Email and Google Fonts Validation ErrorAmp for Email 和 Google 字体验证错误
【发布时间】:2019-07-22 20:12:54
【问题描述】:

根据 AMP 文档,字体允许使用链接标签: https://amp.dev/documentation/guides-and-tutorials/develop/style_and_layout/custom_fonts/?format=websites

但是当我在头部嵌入一个谷歌字体链接标签时:

<link href="https://fonts.googleapis.com/css?family=Open+Sans&display=swap" rel="stylesheet">

我收到一个验证错误: 不允许使用标签“链接”。

有什么见解吗?感谢您的时间和想法。

【问题讨论】:

标签: amp-html amp-email


【解决方案1】:

The docs say custom fonts are allowed in AMP email,但验证者尖叫。

我建议在official AMP project on GitHub 提交错误问题

注意:很少有电子邮件客户端支持自定义字体,所以如果我是你,我会跳过这一步。

【讨论】:

  • Interesting, that page is not part of the email docs (it's not linked to on the left when "email" is selected as format), I'm not sure why它完全可以打开。我为此提交了github.com/ampproject/amp.dev/issues/2553
【解决方案2】:

根据规范的一部分 AMP for Email Supported CSS,AMP for Email 目前既不支持外部样式表 (<link href="..." rel="stylesheet">) 也不支持自定义字体(通过 @font-face)。

有一个添加自定义字体支持的功能请求:#21907

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-03-26
    • 2018-09-16
    • 2011-04-27
    • 2022-12-19
    • 2023-01-24
    • 2023-04-01
    • 2018-11-12
    • 1970-01-01
    相关资源
    最近更新 更多