当父级在 Quirks 模式下呈现时,iframe 内容可以在标准模式下呈现吗?
我有一个 html 页面,它在 iframe 中呈现一个 html 页面,其中我的页面向整个内容添加了一个顶栏。为了使整个页面看起来无缝,我不得不依靠页面的怪异模式渲染来显示以下内容:(类似于谷歌图像结果页面的方式(点击带有顶部框架的图像的页面)-
<table>
<tbody>
<tr>
<td>
<!-- Top bar content -->
</td>
</tr>
<tr>
<td>
<iframe src="http://anysite.com/"/>
</td>
</tr>
</tbody>
</table>
问题在这里是有些页面无法在怪异模式下正确呈现,因此它们无法在 iframe 中正确呈现。我不能妥协)
有替代解决方案吗?
I have an html page which renders an html page in an iframe where my page adds a topbar to the whole content. Inorder to render the whole page seemless, I had to rely on quirksmode rendering of the page to display the following:(similar to the way google image results page(page u get on click of an image with a top frame)-
<table>
<tbody>
<tr>
<td>
<!-- Top bar content -->
</td>
</tr>
<tr>
<td>
<iframe src="http://anysite.com/"/>
</td>
</tr>
</tbody>
</table>
The problem here is that there are pages which donot render properly in quirks mode. So they do not come out properly in the iframe. How will I overcome this? Can I render just the iframe in standards mode while the whole page is rendered in quirks mode(which I cannot compromise) .
Is there an alternative solution?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
延迟回答...但是如果您使用对象标记而不是 iframe 标记,在 IE 中它将更改渲染模式。
不幸的是,在 IE10 中,如果外部页面在 IE8 模式下呈现,则此方法不起作用,
我仍在寻找解决方案...
另请参阅 当包含页面处于怪异模式时,iframe 不以 ie9 模式渲染
Delayed answer... but if you use an object tag instead of an iframe tag, in IE it will change the rendering mode.
Unfortunately, in IE10 this doesn't work if the outer page renders in IE8 mode using
Which I'm still searching for a solution to...
See also iframe not rendering in ie9 mode when containing page is in quirks mode
根据这篇文章(http://css-tricks.com/ie-iframe-quirksmode/< /a>),iframe 中父页面处于怪异模式的页面也将以怪异模式呈现。
根据作者的说法,除了将页面构建得足够坚固以承受怪异模式的破坏之外,您别无选择。
According to this article (http://css-tricks.com/ie-iframe-quirksmode/), a page in an iframe who's parent page is in quirks mode will also render in quirks mode.
According to the author there's nothing you can do except build your page sturdy enough to withstand the brokenness of quirks mode.