在下面的例子中也发现:http://jsfiddle.net/vqBLX/1/有没有办法让块“六”浮动到右列的顶部而不改变其在HTML中的位置?基本的HTML和CSS Float问题
代码示例:
#container{width:200px; backgroung:#ccc;}
.box{width:110px; height:100px; background-color:red;}
.one, .two, .three, .four, .five{float:left}
.six{float:right; background-color:blue; width:90px;}
<div id="container">
<div class="box one"> </div>
<div class="box two"> </div>
<div class="box three"> </div>
<div class="box four"> </div>
<div class="box five"> </div>
<div class="box six"> </div>
</div>
你的第一句话是对的,但OP不希望改变HTML元素的位置。 – 2012-03-01 02:17:52
是的,这就是为什么我展示了如何处理绝对定位 – 2012-03-01 02:18:36
是的,我想我可能不得不使用绝对定位。在我的网站建设中,没有任何其他的东西可以让我完全摆脱“六”的位置。我越来越疲倦,想要确保我不会忽视明显的事情。 – 2012-03-01 02:32:08