最大化iFrame(因此它似乎是请求页面) [英] Maximize iFrame (so it appears to be the request page)

查看:91
本文介绍了最大化iFrame(因此它似乎是请求页面)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何(跨浏览器兼容)最大化一个iFrame,以便它看起来是在URL栏中的页面,即使它是从不同的服务器提供的?

how can I (cross-browser compatible) maximize an iFrame so that it appears to be the page in the URL bar even though it is served from a different server?

推荐答案

我想这应该工作:

<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
 <head>
  <title>Test page!</title>
  <style type="text/css">
     html, body {
        overflow: hidden;
        margin: auto;
        height: 100%;
        width: 100%;
     }
  </style>
 </head>
 <body>
  <iframe src="page.htm" width="100%" height="100%" frameborder="0"></iframe>
 </body>
</html>

编辑1:您可以隐藏页面的滚动条, HTML和scroll = no指令

(该解决方案应该是多浏览器)

Edit 1: You could just hide the scrollbars of the page, with the HTML and scroll=no directive
(that solution should be multi-browser)

编辑2: XHTML proof;)

Edit 2: Now even XHTML proof ;)

编辑3:最后w3验证器确定

(确保添加scroll = no如果您运行Internet Explorer兼容性问题,则为BODY)

Edit 3: And finally w3 validator ok
(be sure to add scroll=no in the BODY if you run in Internet Explorer compatibility problems)

这篇关于最大化iFrame(因此它似乎是请求页面)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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