日期:2014-05-17  浏览次数:20807 次

CSS两列等高的问题,在IE6下有问题,在FF3和IE78下都没有问题
用CSS弄了一个两列等高的例子,一测试发现在IE6下面有问题,不会调整,希望哪位能帮个忙解决下。。。

HTML code

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
html,body{
    margin:0;
    padding:0;
}
.all{
    position:relative;
    padding-left:200px;
    overflow:hidden;
}
.left{
    width:200px;
    background-color:red;
    position:absolute;
    top:0;
    left:0;
    padding-bottom:9999px;
    margin-bottom:-9999px;
}
.right{
    width:100%;
    position:relative;
    background-color:green;
    padding-bottom:9999px;
    margin-bottom:-9999px;
}
</style>
</head>
<body>
<div class="all">
    <div class="left"> 
        fsdfsdf<br />
        fdsfsdf<br />
        SDfsdfSD<br />
        fsdfsdf<br />
        fdsfsdf<br />
        SDfsdfSD<br />
        fsdfsdf<br />
        fdsfsdf<br />
        SDfsdfSD<br />
        fsdfsdf<br />
        fdsfsdf<br />
        SDfsdfSD<br />
        fsdfsdf<br />
        fdsfsdf<br />
        SDfsdfSD<br />
    </div>
    <div class="right"> 
        fdsfds <br />
        fdfdsF<br />
        SDf<br />
        DfD<br />
    </div>
</div>
</body>
</html>




------解决方案--------------------
呃,,这个兼容性问题很纠结

HTML code
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
html,body{
    margin:0;
    padding:0;
}
.all{
    position:relative;
    _position:absolute;
    padding-left:200px;
    overflow:hidden;
}
.left{
    width:200px;
    background-color:red;
    position:absolute;
    top:0;
    left:0;
    padding-bottom:9999px;
    margin-bottom:-9999px;
}
.right{
    width:100%;
    position:relative;
    background-color:green;
    padding-bottom:9999px;
    margin-bottom:-9999px;
}
</style>
</head>
<body>
<div class="all">
    <div class="left">
        fsdfsdf<br />
        fdsfsdf<br />
        SDfsdfSD<br />
        fsdfsdf<br />
        fdsfsdf<br />
        SDfsdfSD<br />
        fsdfsdf<br />
        fdsfsdf<br />
        SDfsdfSD<br />
        fsdfsdf<br />
        fdsfsdf<br />
        SDfsdfSD<br />
        fsdfsdf<br />
        fdsfsdf<br />
        SDfsdfSD<br />
    </div>
    <div class="right">fsdfsdf<br />
        fdsfsdf<br />
        SDfsdfSD<br />
        fsdfsdf<br />
        fdsfsdf<br />
        SDfsdfSD<br />
        fdsfds <br />
        fdfdsF<br />
        SDf<br />
        DfD<br />
    </div>
</div>
<div style="width:100px; height:100px; background-color:red;">IE6下没有这个红色的块</div>
</body>
</html>