How to adjust iframe to full screen without specifying sizes?

If I do not specify any dimensions, the iframe will turn out to be tiny. If I set the dimensions as follows, then it will not scale correctly for different screen resolutions.

<iframe name="report"style="height:1200px;width:800px;"> 

Is there a way to automatically allow an iframe to stretch to full screen?

+6
source share
2 answers

Use%

 <iframe name="report" height="100%" width="100%"></iframe> 
+8
source

Assuming the iframe has no small ancestor with position: relative .

 <iframe name="report"style="position: absolute; top: 0; right: 0; bottom: 0: left: 0;"> 

You should also consider using an external style sheet.

+2
source

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


All Articles