ie双边距
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>什么导致了ie6下面的双边距</title> <style type="text/css"> .box{ width:1000px; border:1px solid #ccc; overflow:hidden; zoom:1;} /*此处是因为下面的浮动导致了容器没撑满*/ 参考css:float教程 .left{ float:left; width:500px; margin-right:20px; height:500px; background-color:#F00;}//完全兼容 margin-left:10px;在ie6下面会显示margin-left:20px; 解决方法:用下划线_margin-left:10px;或者display:inline;表示 .right{ float:right; width:480px; height:500px; background-color:#0F0;} </style> </head> <body> <div class="box"> <div class="left"></div> <div class="right"></div> </div> </body> </html>
border:1px solid #ccc !important;/*important浏览器都支持*/