日期:2014-05-17  浏览次数:20608 次

三列布局在IE6下无法居中
为这个问题改了好多天,
css主要代码如下:
*{ margin:0px; padding:0px; border:0px;}
body,html{margin:0px; padding:0px; text-align:center; background-image:url(images/bg_long.jpg); background-attachment:fixed;}
#header{ height:240px; width:1000px; margin:0px auto;}
#divall{ width:1000px; margin:0px auto; height:1000px;}
#left{ float:left; width:200px; border:#FF6600 dotted 1px; _margin-right:-3px;}
#center{float:left; border:#FF6600 dotted 1px;_margin-right:-3px;}
#right{ float:right; width:200px; border:#FF6600 dotted 1px; _margin-left:-3px;}


html主要代码如下:

<body>
<div id="heade"></div>
<div id="divall">
<div id="left"></div>
<div id="right"></div>
<div id="center"></div>
</div>
</body>
我是把左右中三列 包在diavall块中的,其中id="left",id="right",id="center"里还有div的float浮动,

显示的情况是在ie6下#center跑到#left和#right的下方了,就是换行了,在ie8、ie9等其他浏览器下正常的,左中右同一行并排。望各位高手指点,不盛感激!


------解决方案--------------------

#divall{ width:1000px; margin:0px auto; height:1000px; clear:both;}
#left{ float:left; width:198px; border:#FF6600 dotted 1px; }
#center{float:left; width:598px; border:#FF6600 dotted 1px; }
#right{ float:right; width:198px; border:#FF6600 dotted 1px; }