Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to zoom IFRAME content only without using a frame set?

I need to zoom frame content only. Here in my web page I used zoom: 0.75; height: 520px; width: 800px;. If I increase the zoom value it means that the frame size will be increased.

<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
 <STYLE>

#frame { width: 800px; height: 520px; border: 1px solid black; }
#frame { zoom: 0.75; -moz-transform: scale(0.75); -moz-transform-origin: 0 0; }
</STYLE>
 </HEAD>

 <BODY>

  <IFRAME id="frame" src="http://www.google.com"></IFRAME> 

  </BODY>

</HTML>

In the above sample HTML page I want to zoom the content of the IFRAME without changing the size of that IFRAME.

like image 863
Baskaran Avatar asked Aug 26 '11 09:08

Baskaran


People also ask

How do I resize an iframe?

You should see the attribute "width=" after the URL in the iframe tag. Edit the width in pixels in quotations (" ") after the "width=" attribute. For example, if you want the width to be 300 pixels, you would enter "width="300px"" after the URL in the tag.

Why iframe is not recommended?

If you create an iframe, your site becomes vulnerable to cross-site attacks. You may get a submittable malicious web form, phishing your users' personal data. A malicious user can run a plug-in. A malicious user can change the source site URL.

How do I make an iframe occupy the whole page?

To size the <iframe> , we ignore the width="560" height="315" element properties, and instead use the CSS properties width:100%;height:100%; . That's it: a full-width <iframe> with fixed aspect ratio.


1 Answers

Not sure this works with linked documents, but with locally hosted content the following works:

<IFRAME id="frame" src="local.pdf#zoom=100"></IFRAME> 
like image 179
Luke Hankins Avatar answered Nov 03 '22 21:11

Luke Hankins