开发者

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

This question already has answers here: 开发者_高级运维 Full-screen iframe with a height of 100% (20 answers) Closed 8 years ago.

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


This code probably help you.

<iframe src="" onload="this.width=screen.width;this.height=screen.height;">


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜