iOS 5 Safari 和 IFRAME 元素
在哪里可以找到有关 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找不到任何官方文档列出 iOS5 中
标签的差异,但我发现这些链接确实解释了一些关于新
标签/iOS5 safari 中的更改。
iOS5 中的新 Mobile Safari 内容
iOS SDK iOS 5.0 发行说明
处理事件,Safari Web 内容指南
提到
标签现在可以拉伸到其内部内容的宽度。你想要它是一个固定的宽度吗?
您可以...
iframe
样式设置为您想要的宽度(我确定您已经尝试过此操作)body
标记设置宽度这样iframe
就不会延伸到它之外(不确定这是否有效)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...
iframe
in css to the width you want it (I'm sure you've tried this)body
tag so that theiframe
doesn't stretch outside of it (not sure if this works)<div>
around the content being retrieved by theiframe
that has a set widthEdit: I just read the comment saying to style the
iframe
directly, but you mentioned it doesn't work. I'd try styling the containerdiv
instead, if that's an option.