【问题标题】:amp-boilerplate is not workingamp-boilerplate 不工作
【发布时间】:2019-10-12 18:23:39
【问题描述】:

我正在使用 x-cart 4.7.6。我在 x-cart 模板(皮肤文件夹)的 .tpl 文件中添加了 amp 标签。

所有标签都在工作,但是在添加以下标签“amp-boilerplate”时出现内部服务器错误

<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>

请提供建议为什么我会得到以及如何解决它?

【问题讨论】:

  • 你得到什么错误?您需要查看服务器日志才能看到它。浏览器不知道内部服务器错误的详细信息。

标签: php amp-html x-cart


【解决方案1】:

最后,我找到了这个问题的原因。我们必须在花括号和样式之间留出空间。

旧脚本:

body {-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none;}

新脚本:

body { -webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none; }

它在其他 php 文件中没有空间工作,但仅在 x-cart 中不工作。

【讨论】:

    【解决方案2】:

    我找到了解决这个问题的方法: 你应该只像这样添加@:

        <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>
    

    我使用视觉体育场,这对我有用

    【讨论】:

      猜你喜欢
      • 2016-07-30
      • 2019-01-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多