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

在IE的兼容模式下怎么会产生空行?
在两个DIV之间产生了一个空行,在高速模式或者其他浏览器是正常的,但是在IE内核的兼容模式下就有这个空行,见下图:


HTML代码:

<div class="topright"><div class="zhongbox"><h2>最新文章</h2></div>
<div class="rewen"><ul class="ico3">
      <li><a href="#" target="_blank">测试</a></li>
<li><a href="#" target="_blank">测试</a></li>
<li><a href="#" target="_blank">测试</a></li>
<li><a href="#" target="_blank">测试</a></li>
<li><a href="#" target="_blank">测试</a></li>
</ul></div>
</div>


CSS代码:

.topright{width:298px;border:1px solid #DBDBDB;float:right;overflow:hidden;}
.zhongbox{width:100%;height:20px;line-height:20px;background-color:#EBEBEB;border-bottom:1px solid #DADADA;}
.zhongbox h2{padding-left:10px;font-weight:bold;color:#CD8500;font-size:13px;}
.rewen{width:100%;overflow:hidden;zoom:1;height:100%;clear:both;}
.ico3{float:left;margin:4px 0px;}
.ico3 li{padding-left:16px;background:url(../images/ico-3.gif) 7px 11px no-repeat;height:23px;line-height:23px;overflow:hidden;width:100%;}

------解决方案--------------------
ie6下测试,没有见到你的bug,见:http://jsfiddle.net/TUnvv/
检查你的dede模版,是不是php部分有什么问题,导致html输出时出现问题。
------解决方案--------------------
页面头部加个
<script type="text/javascript" src="https://getfirebug.com/firebug-lite.js"></script>
在IE6下用firebug检查一下HTML标签。
------解决方案--------------------
字体大小设在文字的当前元素上,外层的字体大小设为0即可 font-size:0