#boxes {
width:700px;
background-color: #ffffff
}
#boxes1 {
width: 350px;
float: left;
}
#boxes2 {
width: 350px;
float: right;
}
这创建了两个块,介于两者之间。我该如何创建它,以使
boxes1
与boxes2
将其用于两个盒子。
.boxes {
width: 50%;
float: left;
}
这是因为您将您的#boxes1 {
width: 350px;
float: left;
}
#boxes2 {
width: 350px;
float: right;
}
floothew左右。
#boxes1, #boxes2 {
width: 350px;
float: left;
}
您必须将两个盒子浮动到相同的方向,左右或向左。
#boxes1{
width: 350px;
float: left; /*or right*/ }
#boxes2 {
width: 350px;
float: left; /*or right*/
}
这应该做需要的事情。
#boxes{
width:700px;
background-color: #ffffff
}
#boxes1{
width: 350px;
float: left;
}
#boxes2 {
width: 350px;
float: left;
}
您可以在这里检查:
Http://jsfiddle.net/wbjzw/