问题
2 divs are coming horizontally in same in all except IE6? but in IE 6 second div
is falling under first div. both div
has fixed width and float:left
this is code of container div
#home2colContainer {margin-top:40px;overflow:hidden;width:1000px;}
this is for first div
#home2colLeftColContainer {float:left;margin-left:20px;width:675px;}
and this is for second div
#home2colRightColContainer {float:left;margin-left:30px;margin-top:9px;width:268px;}
回答1:
Try absolutely positioning the second one horizontally, and absolutely relative to the first vertical.
回答2:
I believe you are dealing with the double margin bug ( http://www.positioniseverything.net/explorer/doubled-margin.html ) ..
Add display: inline;
to your home2colLeftColContainer
and it should work..
回答3:
problem is solved
I added _display:inline
to #home2colLeftColContainer
#home2colLeftColContainer {float: left; margin-left: 20px; width: 675px;_display:inline}
and _margin-left: 15px
to #home2colRightColContainer
#home2colRightColContainer {margin-top: 9px; float: left; margin-left: 30px; _margin-left: 15px; width: 268px}
来源:https://stackoverflow.com/questions/2139331/2-div-are-coming-horizontally-in-same-in-all-except-ie6-how-to-solve