"Full screen" <iframe>

Issue

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:

Screenshot of site

Solution

The body has a default margin in most browsers. Try:

body {
    margin: 0;
}

in the page with the iframe.

Answered By – kevingessner

Answer Checked By – Mary Flores (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.