Html 移除 iframe 水平滚动条
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3448265/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Remove iframe horizontal scrollbar
提问by Shankaralwar
I want to remove the horizontal scrollbar in my iframe. I just need a vertical scrollbar to view the lengthy contents. My code is
我想删除 iframe 中的水平滚动条。我只需要一个垂直滚动条来查看冗长的内容。我的代码是
<iframe height='514' width='790'
marginwidth='0' marginheight='0'
frameborder='0'
overflow-y='scroll'
overflow-x='hidden'>
</iframe>
Anyone please solve my problem. Advance Wishes.
任何人都请解决我的问题。提前许愿。
回答by justacoder
In the iframe page itself, add this:
在 iframe 页面本身中,添加以下内容:
body {
overflow-x:hidden;
height:100%; //optional, but it can't hurt.
}
回答by jswanson
If you are using a browser that supports CSS3 you could use the overflow-x property.
如果您使用支持 CSS3 的浏览器,则可以使用 overflow-x 属性。
#my-iframe
{
overflow-x:hidden;
}
回答by Kurkula
Try setting scrolling attribute to "no"
尝试将滚动属性设置为“否”
<iframe scrolling="no" ..............> </iframe>
回答by Tuomas Hietanen
回答by user3506118
The solution is:
解决办法是:
style="overflow-x:hidden;
overflow-y:scroll;
in tag <body>
of page included on iframe
在<body>
包含在页面的标签中iframe
Regards by Raffaele.
拉斐尔的问候。