I would like to create an iframe inside an element. The iframe should fill the whole element.
HTML code:
<div class="parent">
<iframe class="child" src="https://example.com"></iframe>
</div>
Style definition:
.parent {
background: red;
width: 200px;
height: 200px;
overflow:auto;
}
.child {
width:100%;
height:100%;
border: 0;
margin: 0;
padding: 0;
}
Unfortulately an unnecessary vertical scrollbar appears:
Jsfiddle: https://jsfiddle.net/4hqjt9w3/1/
How is it possible to get rid of the scrollbar on the parent element, without overflow: hidden
, or absolute positioning?