外部样式表在AMP页面中无效

V S*_* SH 3 html css amp-html

我正在将我的HTML页面转换为AMP页面.我见过测试网址https://validator.ampproject.org/#.此页面由AMP验证.

屏幕截图获取帮助: 在此输入图像描述

但是当我使用外部Css时.

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.0/css/materialize.min.css">
Run Code Online (Sandbox Code Playgroud)

然后它会失败.

屏幕截图寻求帮助. 在此输入图像描述

那我怎么能访问materialize css文件.因为我在我的网站上使用Materialise Ui框架.

但我也读过

 <style amp-custom> </style>
Run Code Online (Sandbox Code Playgroud)

SO AMP验证页面建议包括amp-custom中的内联css.但实现css是如此之久.它会破坏一些移动浏览器.因为https://github.com/ampproject/amphtml/issues/4555

如果有人有一些想法,请分享.

Lov*_*ola 6

AMP 中禁止使用外部样式样式表.您必须在两者之间包含CSS声明self(最多10,000行).这是为了通过额外的网络请求和阻止渲染来节省时间.

<style amp-custom>
...
</style>
Run Code Online (Sandbox Code Playgroud)