废话不说,有以下的HTML+CSS代码,在IE8\FF\CHROME下都是正常的显示,在IE6\7下会出现重叠现象,希望有朋友能告知原因并给出解决方案:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <title>阿里题1</title>
        <meta http-equiv="Content-type" content="text/html; charset=UTF-8">
        <style type="text/css">
          #container{
           position:relative;
           margin: 200px auto;
width:300px;
height:300px;
          }
            
            .hoverEnlarge {
                background: #CDD8DA;
            }
            
            .leftTopColumn {
                position: absolute;
/* left: 0;
top: 0;*/
                width: 90px;
                height: 150px;
z-index: 999;

            }
            
            .leftBottomColumn {
                position: absolute;
                width: 90px;
                height: 115px;
                margin-top: 157px;
z-index: 998;
            }
            
            .rightColumn {
             /*position:absolute;
left: 97px;*/
margin-left:97px;
                width: 215px;
                height: 270px;
            }
        </style>
    </head>
    <body>
        <div id="container">
            <div class="leftTopColumn hoverEnlarge"></div>
            <div class="leftBottomColumn hoverEnlarge"></div>
            <div class="rightColumn hoverEnlarge"></div>
        </div>
    </body>
</html>想实现一个整体两列, 左列又分上下两栏的布局。

解决方案 »

  1.   

    靠, 知道原因拉  #container{
                                position:relative;
                              margin: 200px auto;
                              width:300px;
                              height:300px;
                           }
    margin:200px auto; 这句去掉就可以了= =~~!!!
      

  2.   


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
        <head>
            <title>阿里题1</title>
            <meta http-equiv="Content-type" content="text/html; charset=UTF-8">
            <style type="text/css">
              #container{
                margin: 200px auto;
                width:300px;
                height:300px;
              }
                
                .hoverEnlarge {
                    background: #CDD8DA;
                }
                
                .leftTopColumn {
                    position: absolute;
                    width: 90px;
                    height: 150px;
                    z-index: 999;
                    
                }
                
                .leftBottomColumn {
                    position: absolute;
                    width: 90px;
                    height: 115px;
                    margin-top: 157px;
                    z-index: 998;
                }
                
                .rightColumn {
                    position:absolute;
                    margin-left:97px;
                    width: 215px;
                    height: 270px;
                }
            </style>
        </head>
        <body>
            <div id="container">
                <div class="leftTopColumn hoverEnlarge"></div>
                <div class="leftBottomColumn hoverEnlarge"></div>
                <div class="rightColumn hoverEnlarge"></div>
            </div>
        </body>
    </html>
      

  3.   

    确实没问题了,可是能说下这个BUG的原因么? 或者有什么链接发一下, 是否是因为静态定位和绝对定位一起会导致margin-left无效? 还是有其他原因