css - 如何覆盖 AMP 页面中的内联样式?

标签 css amp-html

我有一个 html 正文,其中包含一些包含内联样式的标签。通常我们可以使用 !important 覆盖内联 但由于我需要页面是 AMP valid ,所以我无法使用此方法。 有什么方法可以在 AMP 有效方法中执行此操作吗?

最佳答案

否。正如您所提到的,在 AMP you can not use the !important style 中。另外你只能有one style tag and it has to be in the head tag .

您可以内联覆盖常规样式,但反之则不行。

AMP 需要能够强制执行其元素大小调整规则,从而允许 !important 样式干扰该规则。

关于css - 如何覆盖 AMP 页面中的内联样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60545436/

相关文章:

javascript - 适用于 codepen 但不适用于 Wordpress

css - 如何通过 CSS 将模式转化为书面文本?

cross-domain - 哪些 AMP 扩展可以从端点获取响应?

seo - AMP 故事在 Google AMP 验证中被标记为 noindex,但 AMP Story 中没有 noindex 标签

amp-html - Accelerated Mobile Page - 动态页面

amp-html - 创建AMP iframe如何根据内容调整高度

html - Chrome (Win) 中的鼠标中键溢出错误

html - 由于未知原因,Rails pre 标签正在插入标签

javascript - 重叠图像跨越 CSS 或 HTML 中的表格单元格边框

html - AMP Html <a target ="_blank"> 无法在 iphone safari 浏览器上运行以进入新窗口