Safari/Chrome (Webkit) - 无法隐藏 iframe 垂直滚动条 [英] Safari/Chrome (Webkit) - Cannot hide iframe vertical scrollbar
问题描述
我在 www.example.com 上有一个 iframe
,它指向 support.example.com(这是一个指向外部域的 CNAME).
I have an iframe
on www.example.com that points to support.example.com (which is a CNAME to a foreign domain).
我会自动调整 iframe 的高度,这样框架就不需要任何滚动条来显示包含的网页.
I automatically resize the height of my iframe so that the frame will not need any scrollbars to display the contained webpage.
在 Firefox 和 IE 上这很好用,因为我使用 <iframe ... scrolling="no"></iframe>
,所以没有滚动条.但是,在 webkit 浏览器(Safari 和 Chrome)上,即使没有滚动条的页面有足够的空间(滚动条呈灰色),垂直滚动条仍然存在.
On Firefox and IE this works great, there is no scrollbar since I use <iframe ... scrolling="no"></iframe>
. However, on webkit browsers (Safari and Chrome), the vertical scrollbar persists even when there is sufficient room for the page without the scrollbar (the scrollbar is grayed out).
如何隐藏 webkit 浏览器的滚动条?
How do I hide the scrollbar for webkit browsers?
推荐答案
刚好碰到这个问题,发现解决方法是在页面里面的HTML标签上设置overflow: hidden
iframe
.
I just ran into this problem, and discovered that the fix was to set overflow: hidden
on the HTML tag of the page inside the iframe
.
这篇关于Safari/Chrome (Webkit) - 无法隐藏 iframe 垂直滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!