CSS伪类:焦点和:在IE8中不能使用〜combinator

时间:2011-07-12 14:35:44

标签: css internet-explorer-8 css-selectors pseudo-class

我对CSS Pseudo类非常困惑:focus或:active,因为它适用于:在ie8中悬停,但不能使用:focus或:active。 像这样:

<!doctype html>
<head>
<style>
#target{ display:block; width:1em; height:1em; background:lightgreen; }
a[href="#target"]:focus~#target{ width:10em; height:10em;  }
</style>
</head>
<body>
<a href="#target">target</a>
<div id="target" ></div>
</body>
</html>

当我使用:active to replace:focus,同样的问题发生了,但是:悬停效果很好〜 当我使用:焦点或:没有〜活跃,它也很有效。这很困惑〜 TX〜

1 个答案:

答案 0 :(得分:0)

:只有在使用Tab键获取所需链接时才会发生标记焦点。 :对于标签的激活等同于onmousedown。