简体   繁体   English

Iframe 无法在页面放大时滚动到底部

[英]Iframe couldn't scroll to bottom on page zoom in

I have an iframe on my page which has scrolling disabled.我的页面上有一个 iframe 已禁用滚动。 However parent scrollbar couldn't reach the bottom of the page.但是父滚动条无法到达页面底部。 The iframe content got cutoff. iframe 内容被截断。 Can I get some help here please?我可以在这里得到一些帮助吗? codepen link: https://codepen.io/zhr1130/pen/oNdzGdz代码笔链接: https://codepen.io/zhr1130/pen/oNdzGdz

 html,body { height:100%; }.container { position: relative; width: 100%; overflow: visible; height:100%; }.responsive-iframe { width: 100%; height: 100%; }
 <.DOCTYPE html> <html> <body> <h1>The iframe element</h1> <h2>Responsive Iframe</h2> <p>Resize the window to see the effect:</p> <div class="container"> <iframe src="https.//www.redfin.com/" title="W3Schools Free Online Web Tutorials" scrolling="no" width="100%" height="100%" class="responsive-iframe"> </iframe> </div> </body> </html>

Make Iframe height:auto;使 Iframe 高度:自动; check following code检查以下代码

 html,body { height:100%; }.container { position: relative; width: 100%; overflow: visible; height:100%; }.responsive-iframe { width: 100%; height: auto; }
 <.DOCTYPE html> <html> <body> <h1>The iframe element</h1> <h2>Responsive Iframe</h2> <p>Resize the window to see the effect:</p> <div class="container"> <iframe src="https.//www.redfin.com/" title="W3Schools Free Online Web Tutorials" scrolling="no" width="100%" height="100%" class="responsive-iframe"> </iframe> </div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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