响应式iframe仍然有滚动条,并且没有缩放



我正在尝试创建一个响应iframe,但我仍然在两侧有滚动条,交互式图像没有缩放。。。

我认为交互式html(带有悬停状态/弹出窗口的地图(是使用Abode产品生成的

这就是iframe所在的地方:


<div class="resp-container"><iframe class="resp-iframe" title="Sample" src="sample.html"></iframe></div>

这就是CSS:

.resp-container {
position: relative;
overflow: hidden;
padding-top: 56.25%;
}
.resp-iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: 0;
display:block;
}

我是不是做错了什么?如果我将高度更改为"auto",那么iframe由于某种原因会变为150px,即使画布是800px

提前感谢

尝试使用以下引用重新制作您的iframe。它对我来说效果很好:

https://css-tricks.com/responsive-iframes/#:~:text=%20best%20rick%20 for%20 responsible,order%20 to%20 fill%20 The%20 area。

上面的效果最好。我希望它能帮助你解决的问题

最新更新