html - iFrame 和 Div ID 无法按预期用于 iOS iFrame 修复

标签 html ios css iframe

iOS 会自动将可滚动 iFrame 的大小调整为 iFrame 内容的整个高度。

我已经在应用到 div 和 iFrame 的头部混合使用内联样式和样式来修复它,但是当尝试移动样式时,所有样式都移动到头部并将 ID 分配给 Div 和 iFrame,修复无效。

这个有效:

<html>
    <head>
        <style>
            iframe {
                height: 600px !important;
            }
        </style>
    </head>
    <body>
        <div style="overflow: auto; -webkit-overflow-scrolling:touch;"><iframe src="//www.google.com/" width="100%" height="600px"></iframe></div>
    </body>
</html>

这行不通:

<html>
    <head>
        <style>
            #iOSiFrameFix {
                height: 600px !important;
                width: 100% !important;
            }

            #iOSDivFix {
                overflow: auto !important;
                -webkit-overflow-scrolling:touch !important;
            }
        </style>
    </head>
    <body>
        <div id="iOSDivFix"><iframe id="iOSiFrameFix" src="//www.google.com/"></iframe></div>
    </body>
</html>

我不确定我在这里做错了什么。由于某种原因,第二组代码没有应用修复。

最佳答案

两组代码均有效,失败的原因是我们的 CMS 中的发布设置配置错误。

关于html - iFrame 和 Div ID 无法按预期用于 iOS iFrame 修复,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57525736/

相关文章:

html - 为什么有些客户端不能从IIS播放一些html5音频?

html - 让它成为一行,即使 <br> 在那里

javascript - jQuery:检查包含特定值的表行是否已经存在

javascript - 带有 CKEditor 的 jQuery 验证插件

ios - 通过 FTP 协议(protocol)从 iPhone 上传/下载文件

php - js和css按需加载

ios - 在堆栈 View 中阅读文本字段

ios - 将图像添加到推文表 - iOS

javascript - 自动缩放图像以匹配文本高度

html - 如何在 table 周围生成 flex 的边框?