[英]Iframe scrolling overflow hidden not working in css
Here is the iframe 这是iframe
<iframe class="iframe_style" id="iframeid" src="#" height="100%" width="100%" ></iframe>
I'm using CSS as overflow: hidden, but still I'm getting scrolling.. 我正在使用CSS作为溢出:隐藏,但是仍然在滚动。
.iframe_style{
border: 3px solid red;
overflow: hidden;
}
Any help on this? 有什么帮助吗?
Add display: block
to the iframe. 添加
display: block
到iframe。
.iframe_style{
border: 3px solid red;
display: block;
}
Don't forget to account for the border that you have added. 不要忘记考虑您添加的边框。 Subtract the border size from the width and height using jQuery.
使用jQuery从宽度和高度中减去边框大小。
var window_height = $(window).height() - 6;
var window_width = $(window).width() - 6;
JSFiddle: http://jsfiddle.net/Lxjy4ae6/50/ JSFiddle: http : //jsfiddle.net/Lxjy4ae6/50/
body, html {
overflow: hidden;
}
Should do the trick. 应该做到的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.