When I use the following code to create an iframe:
<iframe src="mypage.html" style="border: 0; width: 100%; height: 100%">Your browser doesn't support iFrames.</iframe>
The iframe doesn't go all the way—a 10px white "border" surrounds the iframe. How could I solve this?
Here is an image of the problem:
To cover the entire viewport, you can use:
And be sure to set the framed page's margins to 0, e.g.,- Actually, this is not necessary with this solution.body { margin: 0; }
.I am using this successfully, with an additional
display:none
and JS to show it when the user clicks the appropriate control.Use this code instead of it: