兩列布局中,為什么必須給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
舉報
2016-01-13
可以??!
2016-01-13