<div width="100%">
<div style="float:left;height:50px; width:50%;background:red;"></div>
<div style="float:left;height:50px; width:0px;border-left:1px solid green;border-right:1px solid green"></div>
<div style="float:left;height:50px; width:49%;background:red;"></div>
</div>
想要两个等宽的话就不能都50%
追问谢谢,这样子是不行的,因为背景色不能铺满,右边会有白的
追答<div width="100%" >
<div style="float:left;height:50px; width:50%;background:green;"></div>
<div style="float:left;height:50px; width:50%;background:green;"></div>
<div style="position:absolute;z-index:1;width:2px;background:red;height:50px;left:50%" align="center"></div>
</div>
那就只能把分隔线浮起来了,像这样,想搁哪里搁哪里。
追问谢谢,是个解决方法。