[英]How to style facebook iframe with css?
I have a popup which contains the facebook iframe and its seems like the inline stylesheet method in not work 我有一个包含facebook iframe的弹出窗口,它似乎无法使用内联样式表方法
<div data-html="allow" >
<iframe style="border: 0px; display: block" height="400" class="spoooky-auth" src="https://api.spooo.ky/auth/facebook" border="0"></iframe>
</div>
I am trying to increase the width and height of the iframe but its not work.any clue? 我正在尝试增加iframe的宽度和高度,但不起作用。有任何提示吗?
Any help is appreciated. 任何帮助表示赞赏。 thanks,
谢谢,
I'd use JS for this, like so: 我将为此使用JS ,如下所示:
<div data-html="allow" >
<iframe id="iframe1" style="border: 0px; display: block" height="400" class="spoooky-auth" src="https://api.spooo.ky/auth/facebook" border="0"></iframe>
</div>
<script type="application/javascript">
function resizeIframe {
iframe.width = iframe.contentWindow.document.body.scrollWidth;
iframe.height = iframe.contentWindow.document.body.scrollHeight;
}
window.addEventListener('DOMContentLoaded', function(e) {
var iframe = document.getElementById( 'iframe1' );
resizeIframe;
} );
</script>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.