尝试制作可响应的iframe放置在SS网站上,以便我可以引入外部表单以及我的PWA演示。我在堆栈研究中发现的大多数线程都有死链接。
好的,就是这样。
我的测试网站是www.sunfoundry.com/test123
我已成功通过另一个博客建议使用以下代码使iframe的宽度匹配:
但是经过检查,它无法在台式机或移动设备上呈现页面的高度。
最终,我的目标是能够在像iphone这样的图像容器中获取响应式iframe来预览我的pwa,但现在我只拿iframe
<div class="resp-container">
<iframe class="resp-iframe" src="https://mydbcx.com/?u=jwelle&c=225A13500A&hs" gesture="media" allow="encrypted-media"> </iframe>
</div>
<style>
.resp-container {
position: relative;
overflow: hidden;
padding-top: 56.25%;
}
</style>
<style>
.resp-iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: 0;
}
</style>