Iframe height attribute not working with Firefox

My Firefox (version 3.6.17 on Ubuntu) does not respond to the height attribute of my iframe. (I checked that it works in my Google Chrome.)

 <iframe src="www.example.com" width="100%" height="80%"></iframe> 

or

 <iframe src="www.example.com" width="100%" height="40%"></iframe> 

How can I make it work?

If this is because my version of Firefox is too old, how can I make it work for users who likewise have an old version of Firefox?

+4
source share
1 answer

I checked yout code in firefox 3.6 on OS X and this works for me. To get it working, I added:

 html, body { height:100%; } ​ 

http://jsfiddle.net/XcdJ3/

However, if you have an iframe in any container, it should also have a height:100% property.

Like in this example:

http://jsfiddle.net/XcdJ3/2/

If you cannot deploy the iframe using html and css, try doing this in JavaScript, just take the height of the parent element and apply it to the iframe height tag.

+5
source

Source: https://habr.com/ru/post/1441904/


All Articles