Remove iframe horizontal scrollbar

2019-03-15 05:41发布

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 height='514' width='790' 
        marginwidth='0' marginheight='0' 
        frameborder='0' 
        overflow-y='scroll' 
        overflow-x='hidden'>
</iframe>

Anyone please solve my problem. Advance Wishes.

标签: html iframe
4条回答
贪生不怕死
2楼-- · 2019-03-15 05:52

If you are using a browser that supports CSS3 you could use the overflow-x property.

#my-iframe
{
   overflow-x:hidden;
}
查看更多
可以哭但决不认输i
3楼-- · 2019-03-15 06:03

In the iframe page itself, add this:

body {
    overflow-x:hidden;
    height:100%; //optional, but it can't hurt.
}
查看更多
贪生不怕死
4楼-- · 2019-03-15 06:06

The solution is:

style="overflow-x:hidden;
overflow-y:scroll;

in tag <body> of page included on iframe

SEE THIS LINK PAGE

Regards by Raffaele.

查看更多
欢心
5楼-- · 2019-03-15 06:17

Here is an IFrame-resize script.

However, if you use SSL then there is no way to use a script to communicate between the frame and the main window. It will give an "access denied". :-(

查看更多
登录 后发表回答