简体   繁体   中英

How to remove iframe's scrollbars?

How to remove iframe's scrllbars? In Firefox it's easy, however I found myself unable to achieve this effect to be compatible with all major browsers.

如果CSS技术对您不起作用,请尝试将属性scrolling="no"iframe HTML代码中。

<iframe scrolling="no" src="..." >

CSS

iframe {
   overflow: hidden;
}

And/or use Coin_op's answer , it seems to be better.

on top of Alex's answer, I also had to add the following to remove horizontal toolbars from both FF and Chrome. This was added in the i-frame page, even though it should be possible to add it in the css as well:

    <style>
        iframe::-webkit-scrollbar {  
        display: none;
    }  
    </style>
<iframe runat="server" id="_theFrame"  src="url" width="100%" scrolling="no" height="200" frameborder="0" allowtransparency="true" marginwidth="0" marginheight="0" style="display: block; background: none repeat scroll 0% 0% transparent; width: 100%;" />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM