-1

How to remove the white margins from this web page.

Text

Code of webpage:

<html>

<head></head>

<body>
  <iframe id="i1" src="yoursource1.html" width="100%" style="height:100vh"></iframe>
  <iframe id="i2" src="yoursource2.html" width="100%" style="height:100vh"></iframe>
</body>
<html>

1 Answers1

1

iframes have a default display type of inline. Inline elements are initially designed for text and your iframe acts a bit as one giant character. It has a bit of white space beneath for the descenders of the characters (characters like j and g have descenders).

To cut a long story short, try changing the display type with css (and remove the border).

body {
  margin: 0;
}

iframe {
  display: block;
  border: 0;
}
<iframe id="i1" src="yoursource1.html" width="100%" style="height:100vh; background:black"></iframe>
<iframe id="i2" src="yoursource2.html" width="100%" style="height:100vh; background:black"></iframe>
metatron
  • 896
  • 7
  • 14