<div class="box2 w">
<div class="like-list"></div>
<div class="best-sale"></div>
<div class="login"></div>
</div>
.box2 {
height: 460px;
background: pink;
border-radius:10px;
}
.box2 .like-list {
height: 100%;
width: 390px;
background: red;
float: left;
margin-right: 15px;
}
.box2 .best-sale {
height: 100%;
width: 390px;
background: red;
float: left;
margin-right: 15px;
}
.box2 .login {
height: 100%;
width: 390px;
float: left;
background: red;
}
总宽度你设了460,子元素一个就390了,所以会换行
如果 宽度不够 。就会换行 。 因为 width是写死的