使用媒体查询的 CSS 特征检测

标签 css feature-detection

我正在尝试检测浏览器是否支持 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/

相关文章:

javascript - 2gb 打包(纯 html5、css3 和 javascript)的 chrome 应用程序是否合理?

javascript - 在 while 循环中显示/隐藏函数

python - 如何获取python scipy中的所有音频参数?

使用过滤器的 OpenCV 纹理对象跟踪

Android OpenCV 无法检测圆

algorithm - 使用无专利描述符进行特征检测

javascript - 悬停在图像上时添加 div 元素类

javascript - 如何在加载进度条后向变量添加金额并显示金额

javascript - HTML 中 href 链接的悬停效果

c++ - BriefDescriptorExtractorImpl 中的 OpenCV 错误 : Bad argument (bytes must be 16, 32 或 64)