开发者

IE 7/8: Active Pseudo on Block Elements

i have run into problem regarding IE7/8 ignoring the :active pseudo class on elements开发者_开发百科 with display:block;

HTML:

<a>My Link</a>

CSS That Works:

a:active{color:yellow}

CSS That Fails:

a{display:block}
a:active{color:yellow}

Does anyone know of a solution to this, or will I have to resort to JS?


Ironically, @Kevin already "fixed" your problem without even realising.

Change the HTML from this:

<a>My Link</a>

to this:

<a href="#">My Link</a>

and it works in IE7, see: http://jsbin.com/exuga3

Unexpected things like this can happen when you have <a> tags without an href attribute.

If you really don't want the "hand mouse pointer", specify cursor: default: http://jsbin.com/exuga3/4

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜