how to make a html iframe 100% width and height? [

2019-03-08 23:24发布

This question already has an answer here:

how do I make an iframe 100% width and height of the window?

标签: html iframe
2条回答
看我几分像从前
2楼-- · 2019-03-08 23:58

this code probable help you .

<iframe src="" onload="this.width=screen.width;this.height=screen.height;">
查看更多
Anthone
3楼-- · 2019-03-08 23:59

Answering this just in case if someone else like me stumbles upon this post among many that advise use of JavaScripts for changing iframe height to 100%.

I strongly recommend that you see and try this option specified at How do you give iframe 100% height before resorting to a JavaScript based option. The referenced solution works perfectly for me in all of the testing I have done so far. Hope this helps someone.

查看更多
登录 后发表回答