html - iOS 可滚动 iFrame

标签 html ios css iframe

自 iOS4 以来,存在无法滚动 iFrame 的错误:

index.html

<html>
  <body>
    <iframe style="height:100px;border: 1px solid blue" src="iframe.html"></iframe>
  </body>
</html>

iframe.html

<html>
  <body>
    <div style="height:200px"></div>
  </body>
</html>

您会注意到 height:100px 样式会被 iOS 忽略。

是否有针对此行为的官方故障单?

在 iOS10 中是否可以滚动 iframe 的内容?

最佳答案

试试这个:

 <div style="overflow:auto;-webkit-overflow-scrolling:touch">
   <iframe style="height:100px;border: 1px solid blue" src="iframe.html"></iframe>
</div>

关于html - iOS 可滚动 iFrame,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42061971/

相关文章:

javascript - 如何使用 css 为具有 JS 生成的类名的元素设置样式?

php - 表单方法 ="post"阻止了我的元刷新发生

html - 由于 translate3d,伪元素的边框宽度不一致——但为什么呢?

html - 列的宽度与样式中指定的宽度不同

ios - 进入 Parse 的空文件

ios - 使用自定义数据以编程方式初始化自定义 UIView 的正确方法

iphone - 丢失了我的 xcode 项目中的所有目标

css - "overflow-x: scroll; white-space: nowrap"从背景中溢出的父级内的 div 内容

html - 为 menu li 元素添加边框线

html - 用严格的 html 而不是 transitionl html 编写网站是否被认为更专业?