In this issue here I want the iframe to occupy the whole blue box.
I have given width and height 100% but height has no effect. Any fix?
In this issue here I want the iframe to occupy the whole blue box.
I have given width and height 100% but height has no effect. Any fix?
Change your display: table-row
to display: block
. Also notice that height percentage to fill a div will work only of the parent container has a fixed height, either by px
or something else, or in percentage %
. Here is the corrected fiddle.
Else you may try with your own layout. But add position: absolute;width:300px;height:250px;
to your div #two
. If you want to display some element using percentage, then it's parent container's attributes (width and height) should be defined, and only then, the child will stretch.
Here is the fiddle.
Give <div id="two">
a height:100%
in css. The iframe needs to fill the parent element but without a height set it wont.
I've changed your code slightly in this fiddle. Basically your blue box div needed a height value. Here's the fiddle
You could make the blue div position: relative
and use the following css for the iframe:
iframe {
position: absolute;
left: 0px;
right: 0px;
top: 0px;
bottom: 0px;
}
#two {
position: relative;
/* other CSS for #two */
}