How to remove iframe's scrollbars?

前端 未结 4 1329
不思量自难忘°
不思量自难忘° 2020-12-17 10:58

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.

相关标签:
4条回答
  • 2020-12-17 11:15
    <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%;" />
    
    0 讨论(0)
  • 2020-12-17 11:18

    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>
    
    0 讨论(0)
  • 2020-12-17 11:20

    If the CSS technique isn't working for you, try also adding the property scrolling="no" to the iframe HTML tag.

    <iframe scrolling="no" src="..." >
    
    0 讨论(0)
  • 2020-12-17 11:35

    CSS

    iframe {
       overflow: hidden;
    }
    

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

    0 讨论(0)
提交回复
热议问题