Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Problem with removing white padding edges on iframe

I have a problem with removing the white border on the edge of an iframe. In this html code, I have a button that sends you to a blank tab when clicked.

I have made multiple attempts to remove the white padding edges.
Here is the base code without me trying to remove the padding;
https://jsfiddle.net/4dchkyqt/

Some of the code I tried adding to fix it; iframe.style.margin = "none"; and iframe.style.padding = "0".

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The white border is on the page that holds the iFrame – You need to set it’s body attribute of margin: 0;

For example, add win.document.body.style.margin = '0'; in your script before you append the iFrame to the document

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading