IE6,overflow,hidden下面就是我所收集或遇到的IE6 Bug之一:overflow:hidden失效
当父元素的直接子元素或者下级子元素的样式拥有position:relative属性时,父元素的overflow:hidden属性就会失效。
CSS代码
#parent{height:50px;overflow:hidden;} #child a{position:relative;}
HTML代码
<div id="parent"> <div id="child"> <a href="http://www.baidu.com/">百度</a> <a href="http://www.jb51.net/">wanshiok.com</a> <a href="http://s.jb51.net/">服务器</a> <a href="http://tools.jb51.net">查询工具</a> <a href="http://www.jb51.net/softs">软件下载</a> <a href="http://www.jb51.net/codes">源码下载</a> </div> </div>
我们在IE 6内发现子元素会超出父元素设定的高度,即使父元素设置了overflow:hidden。 解决这个bug很简单,在父元素中使用position:relative;即可解决该bug
即css
#parent{height:50px;overflow:hidden;position:relative;} #child a{position:relative;}
IE6,overflow,hidden
|