这是我的密码:
<div style="background-color:red;border:2px solid red;height:100px;width:500px;float:left;margin-right:20px;margin-bottom:20px;"><center style="font-size:100px;">1</CENTER></div><div style="background-color:red;border:2px solid red;height:200px;width:500px;float:left;margin-right:20px;margin-bottom:20px;"><center style="font-size:100px;">2</CENTER></div>
<div style="background-color:red;border:2px solid red;height:100px;width:500px;float:left;margin-right:20px;margin-bottom:20px;position:relative;top:-100px;"><center style="font-size:100px;">3</CENTER></div>这是一个屏幕:

但问题是,我也希望它看起来更像这样(第三个坏蛋堆在1下面):

发布于 2013-11-13 02:52:15
我不认为需要浮动任何一个DIV,您想要的是内联块元素的默认行为。
display: inline-block;我想你想要这样的东西:http://jsfiddle.net/4Rq6n/
https://stackoverflow.com/questions/19944106
复制相似问题