天天看点

IE6 a:hover失效 原因是haslayout

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>haslayout引起IE6下 a:hover失效</title>
<style>
a:hover {}
a:hover span{color:#F00;}
</style>
</head>

<body>
<a href="#" target="_blank" rel="external nofollow" >鼠标经过时改变我的<span>颜色</span></a>
</div>
</body>
</html>
           

在IE6下鼠标经过span不会变色,其他浏览器都OK,要解决这个问题就必须触发a:hover的haslayout,例如a:hover { display:inline-block}或者a:hover { zoom:1}  a:hover { height:1%;} 等