possible to shrink contents of iframe?

后端 未结 6 2036
长情又很酷
长情又很酷 2020-12-02 18:46

Is there a way to shrink what\'s inside an iframe without adjusting css?

any magical \'zoom\' parameter out there?!!!

I have a 600px preview iframe i want to

6条回答
  •  一整个雨季
    2020-12-02 19:26

    You absolutely can do this, just fine.

    Only caveat is you need to transform the iframe, and position it absolute:

    iframe {
      /* Set the width of the iframe the size you want to transform it FROM */
      width: 1108px;
      height: 710px;
      /* apply the transform */
      -webkit-transform:scale(0.25);
      -moz-transform:scale(0.25);
      -o-transform:scale(0.25);
      transform:scale(0.25);
      /* position it, as if it was the original size */
      position: absolute;
      left: -400px;
      top: -200px;
    }
    

    To see an example look at: http://jsfiddle.net/8DVNa/

提交回复
热议问题