如何扩展iframe的内容? [英] How can I scale the content of an iframe?

查看:153
本文介绍了如何扩展iframe的内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在我的网站的页面中扩展iframe的内容(在我的示例中是HTML页面,而不是弹出窗口)?

How can I scale the content of an iframe (in my example it is an HTML page, and is not a popup) in a page of my web site?

例如,我想以原始大小的80%显示iframe中显示的内容。

For example, I want to display the content that appears in the iframe at 80% of the original size.

推荐答案

Kip的解决方案应该在Opera和Safari上工作,如果你将CSS更改为:

Kip's solution should work on Opera and Safari if you change the CSS to:

<style>
    #wrap { width: 600px; height: 390px; padding: 0; overflow: hidden; }
    #frame { width: 800px; height: 520px; border: 1px solid black; }
    #frame {
        -ms-zoom: 0.75;
        -moz-transform: scale(0.75);
        -moz-transform-origin: 0 0;
        -o-transform: scale(0.75);
        -o-transform-origin: 0 0;
        -webkit-transform: scale(0.75);
        -webkit-transform-origin: 0 0;
    }
</style>

您可能还想指定overflow:hidden在#frame上以防止滚动条。

You might also want to specify overflow: hidden on #frame to prevent scrollbars.

这篇关于如何扩展iframe的内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆