I know using iFrame is strongly discouraged but I need to make the application that runs on IE8 and older and they already have large old codes using iFrames. I was stuck in a problem about the iFrames. Here is my two iframes:
<div>
<div width="20%" height="100%">
<iframe width="20%" name="treestruct" src="menu.html" height="800px"/>
</div>
<div width="70%" height="100%">
<iframe width="80%" name="mainbody" src="content.html" height="800px"/>
</div>
</div>
Recently, I have been asked to make it work for Firefox too. But when I tried to see it on FF, the only first iFrame is shown. It works fine in IE but not in FF or any other modern browsers. I really got stuck what's going on here. What will be the solution for this? I know this might be a minor problem and I am also a great supporter of HTML5 and want to avoid these types of deprecated tags, but I have large code written in old html and have to make them work on IE8 and older. I do not have options. Any suggestions?
sandbox attribute for iframes is Fully Supported on Safari 7.1, which means that any user who'd be accessing your page through Safari 7.1 can see it perfectly.
If the page is https, you cannot load a iframe on that page that is not https. It will result in a "mixed-content error" and for security purposes it will not load. It works in FF because FF is more lax about this security restriction and Chrome happens to be more strict on mixed-content errors.
The iframe element is supported by all modern desktop and mobile browsers.
1. Remove width="100%" from the iframes. 2. Change align="right" to align="left" on the second iframe if you want them completely side-by-side.
According to w3school, you have to close your iframe tag with </iframe>
. So change your code to something like this:
<div>
<div width="20%" height="100%">
<iframe width="20%" name="treestruct" src="menu.html" height="800px"></iframe>
</div>
<div width="70%" height="100%">
<iframe width="80%" name="mainbody" src="content.html" height="800px"></iframe>
</div>
</div>
and give it a try. It should work just fine...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With