我得到的是:
______________________________
| | | |
| div 1 | | div 2 |
| | | |
|______________| | |
| | |
| wrapper |_____________|
|______________ _____________|
| | | div 4 |
| div 3 | |_____________|
|______________|_______________|
现在,我想要的是:
______________________________
| | | |
| div 1 | | div 2 |
| | | |
|______________| | |
|______________ | |
| | |_____________|
| div 3 | _____________|
|______________| | div 4 |
| wrapper |_____________|
|______________________________|
有没有办法只通过css(3)来做到这一点?
答案 0 :(得分:1)
没有float: top
,但你可以将div 1和3左移,2和4右移。然后他们会漂浮在他们上方的空间里。
<div class="left">1</div>
<div class="right">2</div>
<div class="left">3</div>
<div class="right">4</div>