这不是一个真正的答案,但可以帮助其他人找到解决 IE 中此错误的方法。
包含 iframe 的页面
<link href="style.css" rel="stylesheet">
iframe 页面
<link href="style.css?frameX" rel="stylesheet">
参数 frameX 阻止 IE 缓存 css 页面,因此 iframe 具有独立于其他页面的响应式布局。这只是一个黑客(可怕的),并帮助其他人找到这个问题的答案。
示例文件
索引.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="style.css" rel="stylesheet">
</head>
<body>
<p></p>
<hr>
250px frame
<iframe frameBorder="0" src="frame1.html" height="100" width="250" id='frame_1'></iframe>
<hr>
350px frame
<iframe frameBorder="0" src="frame2.html" height="100" width="350" id='frame_2'></iframe>
<hr>
390px frame
<iframe frameBorder="0" src="frame3.html" height="100" width="390" id='frame_3'></iframe>
</div>
</body>
框架1.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="style.css?page=frame1" rel="stylesheet">
</head>
<body>
<p></p>
</body>
</html>
框架2.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="style.css?page=frame2" rel="stylesheet">
</head>
<body>
<p></p>
</body>
</html>
框架3.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="style.css?page=frame3" rel="stylesheet">
</head>
<body>
<p></p>
</body>
</html>
样式.css
iframe{display:block;}
@media (max-width: 8000px)
{
body p:before {content: "bigger than 550px";}
}
@media (max-width: 550px)
{
body p:before {content: "max550";}
}
@media (max-width: 450px)
{
body p:before {content: "max450";}
}
@media (max-width: 350px)
{
body p:before {content: "max350";}
}
@media (max-width: 250px)
{
body p:before {content: "max250";}
}