【问题标题】:What exactly can @supports test for (or not)?@supports 究竟可以测试(或不测试)什么?
【发布时间】:2018-10-22 08:56:20
【问题描述】:

对于@supports,什么算作有效的“feature query”?我一直在试验,到目前为止它不支持(错误地返回 false)2018 Chrome/FF/Safari 中的许多支持的功能:

(div:nth-child(3))
(width:max-content)
(width:minmax(auto,50%))
// ... and so on ...

对我来说,这些似乎是正确格式的“property:value pairs”。它的参数是什么?

【问题讨论】:

    标签: css cross-browser feature-detection


    【解决方案1】:

    您不能使用@supports 测试选择器。它需要一个声明,例如max-width: 10emcolor: black。由于函数是语句的一部分,例如width: calc(100% - 12px),因此也可以接受。

    更多信息请见https://developer.mozilla.org/en-US/docs/Web/CSS/%40supports

    【讨论】:

    • 这很有道理,但它仍然不起作用。以下@supports 语句仍然失败: (div:nth-child(3)) (width: max-content) (width: minmax(auto, 50%))
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-11
    • 1970-01-01
    • 2020-11-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多