Iframe does not fit verically with height 100%
According to the following code, <iframe>
does not adjust vertically even if you set the height
attribute to 100%.
<div class="container">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Panel</h3>
</div>
<div class="panel-body">
<iframe width="100%" height="100%" src="http://superlp.com.br" frameborder="0"></iframe>
</div>
</div>
</div>
Why does this happen? How to solve?
2
Author: Renan Gomes, 2014-12-13
2 answers
Try This:
<!doctype html>
<html>
<head>
<meta charset="iso-8859-1">
<title>Documento sem título</title>
</head>
<body>
<div class="container">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Panel</h3>
</div>
<div class="panel-body">
<iframe width="100%" style="position: absolute" height="100%" src="http://superlp.com.br" frameborder="0" ></iframe>
</div>
</div>
</div>
</body>
</html>
I found a very simple solution: where has height="100%"
, replace with style="height:100vh"
.
1
Author: Yago Marques, 2018-10-30 14:41:57