我正在尝试检测浏览器是否支持 transform
属性。
为此,当媒体查询支持 transform
时,我包装了我想要应用的代码:
@media (transform: none) {
// My code
}
使用此代码,不会触发此部分。
transform
的初始状态是none
所以我想知道为什么它不触发...
最佳答案
从看the most recent media queries spec , 这是不可能的。
另外,引用自here在规范中:
CSS renderers must treat as invalid (and ignore as appropriate) any at-rules, properties, property values, keywords, and other syntactic constructs for which they have no usable level of support.
忽略里面的任何东西都是为了遵守规范。
关于使用媒体查询的 CSS 特征检测,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28833864/