Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make an iframe fit the entire screen without specifying dimensions?

Tags:

html

iframe

If I don't specify any dimensions, the iframe appears tiny. If I do specify dimensions as follows then it does not properly scale for different screen resolutions

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

Is there a way to automatically allow the iframe to stretch to the entire screen?

like image 273
deltanovember Avatar asked Sep 16 '11 02:09

deltanovember


2 Answers

Use %

<iframe name="report" height="100%" width="100%"></iframe>
like image 76
checkenginelight Avatar answered Sep 28 '22 05:09

checkenginelight


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 stylesheet.

like image 33
alex Avatar answered Sep 28 '22 05:09

alex