IE7,8,9不读媒体查询正常。(IE7,8,9 not reading media query p

2019-09-02 02:24发布

我有这个页面这实际上是在所有的浏览器渲染精细,寓意..当浏览器被收缩,以显示布局的移动版本,基于@media查询CSS设置,但不是在IE8,据我可以检查。 如何解决这个问题的。

这里是BTW所有的代码:

<html>
<head><style>
body{margin:0px; padding:0px;}
#a{height:150px; background-color:#ffffff; border-bottom:1px solid #CCC;}
#x{min-height:350px; margin-top: 10px; background-color:#CCC;}
#y{min-height:30px; margin-top: 10px; background-color:#CCC;}


@media all and (min-width:700px){

#b{width:100%;  min-height:400px;}
    #sep {
  margin: auto;
  overflow: hidden;
  width: 960px;
}
    #x{width:65%; float:left;}
    #y{width:32%; float:right; }
#c{background-color:#656565; height:80px;}
.for-mob{display:none;}
.for-desc{background-color:green;}
}
@media all and (max-width:700px){
.for-mob{background-color:green;}
.for-desc{display:none;}
#b{width:100%; min-height:400px; }
#x{width:100%; display:block; }
#y{width:100%; display:block; }
#c{background-color:#656565; height:100px;}

}
</style></head>
<body>

<div id='a'> <h1>I am header </h1>
</div> 

<div id='b'>
<div id='sep'>

    <div id='x'>
    <h1>I am content </h1>
    <h1>I am content </h1>
    <h1>I am content </h1>
    <h1>I am content </h1>
    <h1>I am content </h1>
    <h1>I am content </h1>
    <h1>I am content </h1>
    <h1>I am content </h1>
    <h1>I am content </h1>
    <h1>I am content </h1>
    <h1>I am content </h1>
    <h1>I am content </h1>
    </div>
    <div id='y'>
    <h1>I am sidebar </h1>
    </div>
</div> 
</div> 
<div class='for-desc'><h1>If you shrink the browser, I become invisible</h1> </div>
<div class='for-mob'><h1>If you maximize the browser, I become invisible</h1></div>

<div id='c'>
<h1> I am a simple footer </h1>
</div> 
</body>

Answer 1:

Response.js只的元素创建规则,来模拟媒体查询使用https://code.google.com/p/css3-mediaqueries-js/

这将是更好地只包括IE <9特定CSS,但它是你的:)



文章来源: IE7,8,9 not reading media query properly.