我有一个包含在另一个域的iframe中的页面。问题在于iframe始终使用垂直滚动条加载。我检查了标记,这里是他们如何包含的iFrame:HTML:使iframe高度固定
<iframe class="plugin-frame js-plugin-frame" frameborder="0" marginheight="0" marginwidth="0" width="100%" height="auto" sandbox="allow-scripts allow-forms allow-same-origin allow-popups allow-top-navigation" src="https://mydomain/mypage.html"></iframe>
如果我改变了上面:
<iframe class="plugin-frame js-plugin-frame" frameborder="0" marginheight="0" marginwidth="0" width="100%" min-height="600px" sandbox="allow-scripts allow-forms allow-same-origin allow-popups allow-top-navigation" src="https://mydomain/mypage.html"></iframe>
它的工作原理。
有什么我可以做我的网页上使它工作。我需要摆脱垂直滚动条,并且无法控制第三方标记。在我的iframe的标记中是否需要修复此问题?
也许你可以在你的网站中添加一些针对iframe高度的CSS! – 2017-08-14 14:41:13
你不能在iframe中使用css作为选择器并添加最小高度?这应该工作。 –
我无法更改iframe的CSS,因为iframe中包含的页面和页面位于不同的域中。 – user1640256