首页 > 解决方案 > 将 font-awsome 链接到 amp 页面

问题描述

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
  <title>Shop App</title>
  <style amp-custom>

  </style>

  <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
  <link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>  
<script async src="https://cdn.ampproject.org/v0.js"></script>
</head>

我是 amp 的新手,我想在我的网站中使用 font-awsome,但是当我添加链接时,它会显示错误,任何人都可以建议我如何在 amp 中添加 font-awsome 链接。

这就是我添加字体可怕链接的方式,但它不起作用并且给出验证错误任何帮助都会很棒

标签: htmlcssamp-html

解决方案


将此标签添加到“head”标签中,并在您的 AMP 页面中使用它的类。(在 AMP 页面上有效)

<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>

有关更多详细信息,您可以通过 AMPproject.org 看到:https ://www.ampproject.org/docs/design/responsive/custom_fonts


推荐阅读