osm*_*nes 7 css mobile amp-html
我想链接到css文件:
<link href="/semanticui/semantic.css" rel="stylesheet" />
Run Code Online (Sandbox Code Playgroud)
在#development=1模式下打开chrome 以测试我的放大器页面.我收到此错误:
The attribute 'href' in tag 'link rel=stylesheet for fonts' is set to the invalid value '/semanticui/semantic.css'.
Run Code Online (Sandbox Code Playgroud)
Jef*_*ins 14
不允许使用外部样式表.使用内联样式以避免对css的额外请求.
更多信息可以在以下网址找到:https: //github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#stylesheets
作者可以使用文档
<style amp-custom>头部中的单个标记向文档添加自定义样式.
我正在使用php页面,所以我执行以下操作来添加我的自定义css页面,因此我可以将其分隔并包含在所有页面中,因此只需更改一次等.
<style amp-custom>
<?php readfile( getcwd() . "/css/main.min.css"); ?>
</style>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6979 次 |
| 最近记录: |