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:
The
body
has a default margin in most browsers. Try:in the page with the
iframe
.Use
frameborder="0"
. Here's a full example:Try adding the following attribute:
You could try
frameborder=0
.You can also use viewport-percentage lengths to achieve this:
Where
100vh
represents the height of the viewport, and likewise100vw
represents the width.Example Here
This is supported in most modern browsers - support can be found here.
Impossible to say without seeing a live example, but try giving both bodies
margin: 0px