IE6文字溢出的BUG不仅仅是注释造成的以及解决办法
插入代码:
<div style="width:400px">
<div style="float:left"></div>
<!-- -->
<input type="hidden" value="hidden" />
<div style="display:none;">hidden</div>
<div style="float:left;width:400px">IE6文字溢出的BUG</div>
</div>
<div style="float:left"></div>
<!-- -->
<input type="hidden" value="hidden" />
<div style="display:none;">hidden</div>
<div style="float:left;width:400px">IE6文字溢出的BUG</div>
</div>
开始很快想到的是注释,看了源代码,发现页面里根本没有注释。实在摸不着头脑,祭出了Google,注意到了当初没有注意到的一句话“但IE6的这个重复BUG也有些不是注释造成的,但基本上都和浮动有关系”。后来有查阅到其他文章提到type=hidden的input以及display:none的div也会导致文字溢出的BUG,正好代码有type=hidden的input。
在同事的帮助下(偶E问很烂)查阅了国外的资料,解决了type=hidden的input造成文字溢出的问题。不要把这个input直接放在form下面,可以用div或者fieldset把这个input包起来。
插入代码:
<div style="width:400px">
<div style="float:left"></div>
<div><input type="hidden" value="hidden" /></div>
<div style="float:left;width:400px">IE6文字溢出的BUG</div>
</div>
<div style="float:left"></div>
<div><input type="hidden" value="hidden" /></div>
<div style="float:left;width:400px">IE6文字溢出的BUG</div>
</div>
插入代码:
<div style="width:400px">
<div style="float:left"></div>
<!-- -->
<div style="float:left;width:400px"><div>IE6文字溢出的BUG</div></div>
</div>
<div style="float:left"></div>
<!-- -->
<div style="float:left;width:400px"><div>IE6文字溢出的BUG</div></div>
</div>
插入代码:
<div style="width:400px">
<div style="float:left"></div>
<div><div style="display:none;">hidden</div></div>
<div style="float:left;width:400px">IE6文字溢出的BUG</div>
</div>
<div style="float:left"></div>
<div><div style="display:none;">hidden</div></div>
<div style="float:left;width:400px">IE6文字溢出的BUG</div>
</div>
浙公网安备 33010602011771号