浮动 - 定位规则取决于某些东西,所以没有那个东西你永远不会对齐对象。因此,您应该使用以下顺序:
<div style="background-color:Aqua">
<div style="float:right;max-width:50%;">Right</div><!-- 100% by default -->
<div>Left</div>
<div style="clear:right;"></div><!-- closing the floating -->
</div>
否则:
<div style="background-color:Aqua">
<div style="float:left;max-width:50%;">Left</div>
<div>Right</div>
<div style="clear:left;"></div>
</div>
或两者:
<div style="background-color:Aqua">
<div style="float:left;max-width:30%;">Left</div>
<div style="float:right;max-width:30%;">Right</div>
<div>Center</div>
<div style="clear:both;"></div>
</div>