Chrome 上没有 IFrame 滚动条
我正在使用 IFrame 来显示来自其他域的一些内容。问题是我可以使用指定的高度和宽度(我正在使用),并且 IFrame 内的内容无法完全容纳在 IFrame 中。因此,我需要滚动条。
我使用了以下 html 代码 -
**<iframe style = "overflow-x:scroll; overflow-y:scroll;" src = "http://shopsocial.ly/merchant/fanpage?merchant_name=cafepress"
height = "400" width = "500">**
这在 Firefox 中运行良好。但在 Chrome 中,我在 IFrame 中没有看到任何滚动条。我已经搜索过这个问题并尝试了很多方法,但都没有解决我的问题。有人可以帮我解决这个问题吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
在您的 iframe 内容中添加 inline:
或在附加到 iframe 的 css 文件中添加
,当然按照 Tom 的建议,请确保使用
scrolling="yes"
和style="overflow:visible; "
在 iframe 上:如果仍然不起作用,请尝试像这样包装 iframe:
In your iframe content add inline:
or in the css file attached to the iframe
and of course as recommended by Tom make sure you use
scrolling="yes"
andstyle="overflow:visible;"
on the iframe:If it still does not work then try to wrap the iframe like this:
您可以使用 iframe 的 scrolling 属性,而不是使用 CSS 样式,并将其设置为
yes
(即始终显示滚动条):Instead of using the CSS style you could use the scrolling property of the iframe and set it to
yes
(i.e. always display scrollbars):Yap Tom 是绝对正确的,你可以使用它
,它应该像我测试过的那样工作。
如果仍然不起作用,请将 Chrome 更新到最新版本。 :)
Yap Tom is absolutely right you can use
and it should be work as i have tested.
If it still does not work then update Chrome to latest version. :)
要使其在所有移动设备(特别是 iPhone 设备)上可滚动,您需要将 CSS 添加到 iframe 周围的 div:
To make this scrollable on all mobile devices (specially iPhone devices), you will need to add CSS to the div around the iframe: