iOS 5 Safari 和 IFRAME 元素

发布于 2024-12-09 18:28:32 字数 147 浏览 2 评论 0原文

在哪里可以找到有关 iOS 5 Safari 中 IFRAME 元素新行为的文档?经验证据表明,IFRAME 现在将扩展以适应内容,从而扩展包含的文档来实现此目的,从而经常破坏在 iOS4.3(和桌面浏览器)中正​​常工作的代码。

有什么办法可以控制这种新行为吗?

Where can I find documentation about the new behavior of the IFRAME element in iOS 5 Safari? Empirical evidence suggests that IFRAMEs now will expand to fit the content, expanding the containing document to do so, thereby often breaking code that works fine in iOS4.3 (and desktop browsers).

Is there any way to control this new behavior?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

花想c 2024-12-16 18:28:32

我找不到任何官方文档列出 iOS5 中 标签的差异,但我发现这些链接确实解释了一些关于新 标签/iOS5 safari 中的更改。

iOS5 中的新 Mobile Safari 内容

iOS SDK iOS 5.0 发行说明

处理事件,Safari Web 内容指南

提到 标签现在可以拉伸到其内部内容的宽度。你想要它是一个固定的宽度吗?

您可以...

  1. 尝试将 css 中的 iframe 样式设置为您想要的宽度(我确定您已经尝试过此操作)
  2. body 标记设置宽度这样 iframe 就不会延伸到它之外(不确定这是否有效)
  3. iframe< 检索的内容周围放置一个
    /code> 具有设定的宽度

编辑:我刚刚读到评论说直接设置 iframe 的样式,但你提到它不起作用。如果可以的话,我会尝试设置容器 div 的样式。

I couldn't find any official documentation that lists the differences of the <iframe> tag in iOS5, but I found these links which do explain a little bit about the new <iframe> tag/changes in iOS5 safari.

New Mobile Safari stuff in iOS5

iOS SDK Release Notes for iOS 5.0

Handling Events, Safari Web Content Guide

You mentioned that the <iframe> tag now stretches to the width of the content inside it. Would you want it to be a set width?

You could either...

  1. Try styling the iframe in css to the width you want it (I'm sure you've tried this)
  2. Set a width to the body tag so that the iframe doesn't stretch outside of it (not sure if this works)
  3. Put a <div> around the content being retrieved by the iframe that has a set width

Edit: I just read the comment saying to style the iframe directly, but you mentioned it doesn't work. I'd try styling the container div instead, if that's an option.

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