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

查看:162
本文介绍了如何缩放 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>

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

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

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

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