<分区>
<分区>
我的网站似乎可以在除 IE 8 之外的所有浏览器中运行。iFrame 可以正常加载所有内容。
这是我的 HTML 代码:
<head>
<title> Title </title>
<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
<script type="text/javascript" src="respond.min.js"></script>
</head>
<body>
<iframe src="http://instagram.com/p/cR5BORA8Ij/embed/"
width="300" height="400" frameborder="0"
scrolling="no" allowtransparency="true" id="myFrame"></iframe>
</body>
对我可能做错的地方有什么建议吗?
最佳答案
创建一个在 html
元素上有 position:relative
的页面
<html style="position:relative">
<head></head>
<body>TEST</body>
</html>
这是一个 fiddle 中的测试页面,它就是这样做的:
现在在 iFrame 中使用该页面并在 IE8 中打开
<html>
<head></head>
<body>
<iframe src="http://jsfiddle.net/KyleMit/DZbt5/show/light/"></iframe>
</body>
</html>
如前一个答案所示,您可以从原始 html 页面中删除 position:relative
,但您可能无法访问该页面或无法更改它。
相反,您可以简单地将相对位置添加到 iframe
元素本身:
iframe {
position: relative;
}
这里也有人问了问题:
关于html - iFrame 未加载 IE 8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17930418/