两列布局中,为什么必须给div指定height,才能正确布局?
.left {
width:30%;
height:500px;
float:left;
background-color:black;
}
.right {
width:70%;
height:500px;
float:right;
background-color:pink;
}必须如上图的代码一样才能成功布局,如果缺少height,就都不行了。
.left {
width:30%;
height:500px;
float:left;
background-color:black;
}
.right {
width:70%;
height:500px;
float:right;
background-color:pink;
}必须如上图的代码一样才能成功布局,如果缺少height,就都不行了。
2016-01-13
举报