<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.2600.0" name=GENERATOR></HEAD>
<BODY    ><iframe  onload="this.height=document.body.offsetHeight;this.width=document.body.offsetWidth"  id="frm1" src="http://www.sina.com.cn">
dd</BODY></HTML></慕白兄>

解决方案 »

  1.   

    最好是要这样写,在iframe里面所在的网页的onload中写
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <script>
    function init(){
    if(parent.location!=self.location){
    var w=document.body.scrollWidth
    var h=document.body.scrollHeight
    with(parent.document.getElementById("ifm")){
    style.pixelWidth=w
    style.pixelHeight=h
    }
    }
    }
    </script>
    </head>
    <body onload=init()>
    <p align="center">iframe</p>
    <p align="center">自</p>
    <p align="center">适</p>
    <p align="center">应</p>
    <p align="center">宽</p>
    <p align="center">和</p>
    <p align="center">高</p>
    <p align="center">!!!</p>
    ifm
    <iframe id=ifm src="sub.htm" scrolling=no></iframe>
      

  2.   

    javascript版的FAQ里有好几个答案
      

  3.   

    把 fason(【阿信(你是我的温柔)】)  提供的init函数放到主界面的<BODY ONLOAD="init()">
      

  4.   

    不行啊!<html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <script>
    function init(){
    if(parent.location!=self.location){
    var w=document.body.scrollWidth
    var h=document.body.scrollHeight
    with(parent.document.getElementById("ifm")){
    style.pixelWidth=w
    style.pixelHeight=h
    }
    }
    }
    </script>
    </head>
    <body onload=init()>
    <iframe id=ifm src="http://163.com" scrolling=no></iframe>
    </body>
    </html>
    只有一个和窗口一样大小的界面,没有高度的