<div id="divShowData" style="height: 480px; width: 650px; overflow-y: scroll; position: absolute;
        z-index: 200; border: 1px solid #000000; background-color: White; margin-left: 210px;
        margin-top: 38px; vertical-align: top">
        <div style="position: absolute; z-index: 180; border: 1px solid #ffffff; background-color: #247eca;
            margin-left: 405px; margin-top: 0px; vertical-align: middle; text-align: center;
            cursor: hand; color: White; top: 0px; left: 230px; width: 0px;" 
            title="提示">取消
            <a onclick="document.getElementById('divShowData').style.display=document.getElementById('divShowData').style.display==''?'none':'';"></a>
        </div>
    ................................
  </div>2个div层,其中里面那个层在IE6可以显示,而在IE8中无法显示,哪个帮我处理一下呢,在哪个地方不兼容哦?

解决方案 »

  1.   

    区分firefox,IE7,IE6
    background:green!important; *background:orange; _background:blue;注:不管是什么方法,书写的顺序都是firefox的写在前面,IE7的写在中间,IE6的写在最后面。
      

  2.   

    问题原因:IE8无法显示未设置具体高度的DIV
    解决办法:给未设置高度的内层DIV加heiht参数。IE浏览器升级到IE8以后,你必须设定DIV的高度,否则该层将不被显示。你没看到区别吗?你外层的DIV有设置H和W的参数,而内层DIV缺少height和width的定义。
    如果想让DIV自由扩展高度,可以设置min-height参数,但IE9对这一属性支持不够好。
      

  3.   

    内层DIV缺少height和width的定义  注意样式书写的顺序
      

  4.   

        <div id="divShowData" style="height: 480px; width: 650px; overflow-y: scroll; position: absolute;
            z-index: 200; border: 1px solid #000000; background-color: White; margin-left: 210px;
            margin-top: 38px; vertical-align: top">
            <div style="position: absolute; z-index: 180; border: 1px solid #ffffff; background-color: #247eca;
                margin-left: 405px; margin-top: 0px; vertical-align: middle; text-align: center;
                cursor: hand; color: White; top: 0px; left: 230px; width: 0px;" 
                title="提示">取消
                <a onclick="document.getElementById('divShowData').style.display=document.getElementById('divShowData').style.display==''?'none':'';"></a>
            </div>
     
      </div>
      

  5.   

    贴错了     <div id="divShowData" style="height: 480px; width: 650px;  overflow-y: scroll; position: absolute;
            z-index: 200; border: 1px solid #000000; background-color: White; left: 210px;
            top: 38px; vertical-align: top;  overflow:-moz-scrollbars-vertical;
     ">
            <div style="position: absolute; z-index: 180; border: 1px solid #ffffff; background-color: #247eca;
                  vertical-align: middle; text-align: center;
                cursor: hand; color: White; top: 0px; left: 615px; *_left:620px; width: 15px;" 
                title="提示">取消
                <a onclick="document.getElementById('divShowData').style.display=document.getElementById('divShowData').style.display==''?'none':'';"></a>
            </div>
     
         </div>