0

I have an iframe with a width and a height of 400px. I would call a web page in the iframe, but I would adjust the width of the source to the size of my iframe. For height this will not be a problem, I can set up an elevator. Below is my code.

<div id = popup><iframe src=\'http://www.google.fr' scrolling=\'yes\' name=\'google\' align=\'center\' marginwidth=\'auto\'></iframe></div>
Dharman
  • 21,838
  • 18
  • 57
  • 107
Geo-x
  • 235
  • 1
  • 4
  • 19
  • `width: 100%` on the body of the page in the frame should do the trick. Do you have direct control over the webpage you're loading in the frame? If not you'd need to do something like [this](http://stackoverflow.com/a/6960628/912500) to inject css into the frame to fit your needs. – Demnogonis Jun 24 '16 at 07:31
  • This might be what you are looking for: http://stackoverflow.com/questions/2630308/possible-to-shrink-contents-of-iframe – denchu Jun 24 '16 at 07:34
  • I don't have the direct control of the source webpage? I'll try your solution. – Geo-x Jun 24 '16 at 07:36

1 Answers1

0

Maybe you could check if this works for you.

#frame {  
    -ms-zoom: 0.5;
    -ms-transform-origin: 0 0;
    -moz-transform: scale(1);
    -moz-transform-origin: 0px 100px;
    -o-transform: scale(1);
    -o-transform-origin: 0px 100px;
    -webkit-transform: scale(1);
    -webkit-transform-origin: 0 0;
    width: 400px;
    height: 400px;
    }

JSFIDDLE

denchu
  • 749
  • 5
  • 10
  • It works with jsfiddle, but if I try with google for example I've this : Load denied by X-Frame-Options: https://www.google.fr/?gws_rd=ssl does not permit cross-origin framing. With an other website, the origin size don't change. – Geo-x Jun 24 '16 at 08:21