What happens when media queries aren't supported?

 ̄綄美尐妖づ 提交于 2020-01-24 12:41:13

问题


Say for example I had this:

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

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)


回答1:


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.



来源:https://stackoverflow.com/questions/17158334/what-happens-when-media-queries-arent-supported

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!