将这三个容器均匀对齐

时间:2012-03-12 00:50:50

标签: css html css-float

我希望此布局如下所示:

__________________________
|  |                      |
|  ------------------------
|__|______________________|

这就是我想要标题的样子。但是,正如您在下面的链接中看到的那样,右侧的两个div正在下降: http://jsfiddle.net/A5YDJ/3/

有什么想法吗?

3 个答案:

答案 0 :(得分:3)

您忘记将float:left添加到#left-box

#left-box{
 width:190px;
 height:90px;
 background-color:blue; 
 float:left;
}

看看这个:http://jsfiddle.net/puCrJ/

答案 1 :(得分:0)

这是正确的CSS,你是浮动错误的div:

#left-box{
    width:190px;
    height:90px;
    background-color:blue; 
    float:left;
}

#top-rel-container{
    float:left;
    width:400px;
    height:90px;
}
#head-top-thin{
    height:45px;
    background-color:red;
    width:400px;
}
#head-bottom-thin{
    width:400px;
    height:45px;
    background-color:green;
}

#cont{
    width:100%;
    height:90px;
    margin:0 auto;
}​

答案 2 :(得分:0)

使用

float:left;

检查您更新的小提琴here

相关问题