2 div are coming horizontally in same in all except IE6? how to solve?

£可爱£侵袭症+ 提交于 2019-12-25 04:15:07

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!