当一个div中包含两个div ,这个两个div怎么才能排成一排啊

都是相对定位的
2025-03-24 08:10:24
推荐回答(3个)
回答1:

给你个例子:




this is the right




#container {margin:0 auto; width:900px;}
#sidebar { float:left; width:200px; height:500px; background:#6cf;}
#content { float:right; width:695px; height:500px; background:#cff;}/*因为是固定宽度,采用左右浮动方法可有效避免ie 3像素bug*/

回答2:

设定好宽度,float:left就可以了

回答3:

div浮动float:left;或把div变成 display:inline; 行内元素