如何让2个div并排显示
2016-11-07 本文已影响11人
Arnold_Z
1、使用display的inline属性
<div style="width:300px; height:auto; display:inline; background:yellow">AAAA</div>
<div style="width:300px; height:auto; display:inline; background:red">BBBB</div>
2、使用float
<div style="width:300px; height:auto; float:left; background:yellow">AAAA</div>
<div style="width:300px; height:auto; float:left; background:red">BBBB</div>