Is there a way to set an iFrame element to the size of elements inside it, discluding margins?
For example, if I set an iFrame of https://example.com, it will show
<iframe src="https://example.com"></iframe>
and I can change the height and width with CSS or JS but can I automatically set the width and height of an iFrame so that there is no scroll?
I tried doing something like
onload='this.style.height=this.contentWindow.document.body.scrollHeight+"px";this.style.width=this.contentWindow.document.body.scrollWidth+"px";'
but it did not work.
Any help would be deeply appreciated.