我有一个 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/