当父级在 Quirks 模式下呈现时,iframe 内容可以在标准模式下呈现吗?

发布于 2024-08-23 02:07:52 字数 572 浏览 2 评论 0原文

我有一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

与之呼应 2024-08-30 02:07:52

延迟回答...但是如果您使用对象标记而不是 iframe 标记,在 IE 中它将更改渲染模式。

<html>
<head>
    <title>Quirks mode + iframe test</title>
</head>
<body>
    <object type="text/html" data="http://stevesspace.com/test/quirks/modern.html" style="width: 300px; height: 500px;"></object>
</body>
</html>

不幸的是,在 IE10 中,如果外部页面在 IE8 模式下呈现,则此方法不起作用,

<META http-equiv=X-UA-Compatible content=IE=8>

我仍在寻找解决方案...

另请参阅 当包含页面处于怪异模式时,iframe 不以 ie9 模式渲染

Delayed answer... but if you use an object tag instead of an iframe tag, in IE it will change the rendering mode.

<html>
<head>
    <title>Quirks mode + iframe test</title>
</head>
<body>
    <object type="text/html" data="http://stevesspace.com/test/quirks/modern.html" style="width: 300px; height: 500px;"></object>
</body>
</html>

Unfortunately, in IE10 this doesn't work if the outer page renders in IE8 mode using

<META http-equiv=X-UA-Compatible content=IE=8>

Which I'm still searching for a solution to...

See also iframe not rendering in ie9 mode when containing page is in quirks mode

思慕 2024-08-30 02:07:52

根据这篇文章(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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文