很简单的问题,求兼容FF和IE的方法,如何让DIV占满整个页面

解决方案 »

  1.   

    把DIV设一下属性:width=100%,height=100%
      

  2.   

    在IE里不行!
    再问个问题,在火狐里DIV的透明效果怎么弄呢?
      

  3.   

    div(height:98%;width:98%;margin:2%;)
    么测试啊!
      

  4.   

    document.documentElement.clientHeight
    document.documentElement.clientWeight
      

  5.   

    在IE里,对于高度它会根据放置于里面的控件进行自动调整,应该不用担心的。对于你第二个问题,我能想到的也只能用filter属性了。下面是我在vs2005里测试用的代码:
    <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %><!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" >
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <div style="width: 100%; height: 100%;background-color: #0099ff;">
                <asp:Panel ID="Panel1" runat="server" Height="116px" Style="filter: progid:dximagetransform.microsoft.alpha(opacity=50);
                    background-color: #00ffff" Width="231px">
                </asp:Panel>
            </div>
        
        </div>
        </form>
    </body>
    </html>在我这测试是成功的
      

  6.   

    在firefox里就没有测试过,楼主自己试下吧