Iframe does not fit vertically with height 100%

2

According to the following code, the <iframe> does not adjust vertically even if setting 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?

    
asked by anonymous 14.12.2014 / 00:27

2 answers

3

try this:

<!doctype html>
<html>
<head>
<meta charset="iso-8859-1">
<title>Documento sem t&iacute;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>
    
18.12.2014 / 17:14
0

I found a very simple solution: Where height="100%" , replace style="height:100vh" .

    
30.10.2018 / 15:06