【问题标题】:The @supports CSS at-rule is not working properly@supports CSS at-rule 不能正常工作
【发布时间】:2020-03-13 00:36:14
【问题描述】:

在 iOs 设备中 background-attachment: fixed; 不起作用,所以我找到了使用 @supports CSS 规则的解决方法。

它在 testground 站点中正常工作,但是当我尝试将它应用到主站点 css 时它没有工作。

在测试场站点中,我通过以下方式将其直接应用到<head>

<style>
.paral2 {
    min-height: 300px;
    background-attachment: fixed;
    background-size: auto;
    background-position: center;
    background-repeat: no-repeat;
    }
@supports (-webkit-touch-callout: none) {
.paral2 {
    min-height: 300px;
    background-attachment: scroll;
    background-size: auto;
    background-position: center;
    background-repeat: no-repeat;
    }
}
</style>

但在主站点中,我必须(根据客户要求)使用style.css 文件,所以我这样应用它:

@supports (-webkit-touch-callout: none) {
.paral {
    min-height: 300px;
    background-attachment: scroll;
    background-size: auto;
    background-position: center;
    background-repeat: no-repeat;
    }
}

.paral {
min-height: 300px;
background-attachment: fixed;
background-size: auto;
background-position: center;
background-repeat: no-repeat;
}

它不起作用,我不知道为什么,我完全迷路了。

可能是相关的,在style.css 文件中,@supports 规则及其以下元素看起来很奇怪,请参见下图:

只有.paral 类中的第一个元素被涂成黄色。

任何形式的帮助都将不胜感激,并一如既往地提前致谢。

【问题讨论】:

    标签: css ios bootstrap-4 webkit


    【解决方案1】:

    原来@support 规则运行良好,问题是清除手机的缓存,如果我没有清除手机的整个历史记录,这些更改永远不会完全应用,我觉得很傻,但至少它得到了解决。

    【讨论】:

      猜你喜欢
      • 2016-03-06
      • 2023-01-11
      • 2012-11-26
      • 2017-05-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-29
      • 1970-01-01
      相关资源
      最近更新 更多