不支持媒体查询时会发生什么? [英] What happens when media queries aren't supported?

查看:60
本文介绍了不支持媒体查询时会发生什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

比如说我有这个:

@media screen and (min-width: 480px) {
     .example {
         background-color: red;
     }
}

如果我在Internet Explorer 8中查看此页面怎么办?即使宽度超过480px,它仍然会把.example变成红色,还是会忽略媒体查询中的内容? (由于我没有IE8:P,所以我无法对其进行测试)

What if I view this page in Internet Explorer 8? Will it still color .example red even though the width is over 480px, or will it just ignore the stuff in the media query? (I can't test it because I don't have IE8 :P)

推荐答案

我刚刚在IE7/IE8浏览器/文档模式(IE10)中进行了尝试,它完全忽略了 all 内的CSS媒体向我询问,就像我想的那样. .example仅在IE9 +中显示为红色背景.

I've just tried it out in IE7/IE8 browser/document modes (IE10), and it completely ignores all CSS inside Media queries for me as I assumed it would do. .example turns out with a red background only in IE9+.

我可以找到的规范中唯一与(实际)相关的部分是

The only section in the specification I can find which is (probably) relevant to what actually happens here is the Error handling section.

这篇关于不支持媒体查询时会发生什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆