简体   繁体   English

媒体查询无法在IE8中运行

[英]media queries not working in IE8

I am trying to learn mediaqueries and I need some help. 我正在尝试学习媒体查询,我需要一些帮助。

My code is not working in IE8 我的代码在IE8中不起作用

CSS CSS

body {
    font-size:11em;
    color:#000;
    transition:all .5s ease-in-out;
    -o-transition:all .5s ease-in-out;
    -moz-transition:all .5s ease-in-out;
    -webkit-transition:all .5s ease-in-out;
}

@media screen and (max-width:500px) {
body {
        font-size:5em;
        color:#ff0000;
  }
}
</style>

HTML HTML

<body>
az a s d a sd
</body>

Please suggest, what should I do to make it run in IE8 or lesser? 请建议,我该怎么做才能让它在IE8或更低版本中运行? I added css3-mediaqueries.js in </head> section (you can see code mentioned below) but it's not helping me. 我在</head>部分添加了css3-mediaqueries.js (你可以看到下面提到的代码),但它并没有帮助我。

<!-- css3-mediaqueries.js for IE less than 9 -->
<!--[if lt IE 9]>
<script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script>
<![endif]-->

Thanks in advance :) 提前致谢 :)

If css3-mediaqueries.js wont work - try Respond . 如果css3-mediaqueries.js无效 - 请尝试回复 Just keep this as a note as well for using CSS3-mediaqueries.js - it's from their site -> 只需将此作为注释使用CSS3-mediaqueries.js - 它来自他们的网站 - >

Note: Doesn't work on @import'ed stylesheets (which you shouldn't use anyway for performance reasons). 注意:不适用于@ import'ed样式表(出于性能原因,您不应该使用它们)。 Also won't listen to the media attribute of the <link> and <style> elements. 也不会监听<link><style>元素的media属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM