我发现IE9正在为我的网站采用平板电脑样式.
@media (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait),(min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) { /* tablet styles */ }
当浏览器的宽度为1024px时,上述媒体查询将应用于IE9.
做了一些研究之后,我发现了以下问题/解决方案,它提供了解释为什么会发生这种情况的原因.
Media query not working in IE9
From what I can tell,it comes down to IE9 not interpreting
“min-device-width” and “max-device-width”.According to 07001 it does
not support those properties,only “min-width” and “max-width”.In addition,07002
states that the browser is supposed to ignore properties that it does
not recognize. Not so with IE9 it seems.
我也发现了这个问题:Common breakpoints for media queries on a responsive site但它没有给我一个解决方案.
如何将样式表仅应用于平板电脑而不是IE9等桌面浏览器,宽度为1024px?