Skip to content


Subversion checkout URL

You can clone with
Download ZIP

Avoid un anchored hovers

Niall Murphy edited this page · 1 revision

When <!DOCTYPE> Strict is set, IE expects the :hover selector to always be anchored with the <a> tag.

Rule Details

Rule ID: non-link-hover

This rule checks that the :hover selector is always anchored with the <a> element otherwise its throws an error, Having un-anchored :hovers can have serve performance degradation in IE7. IE8 is also effected by this issue but to a lesser degree.

The following patterns will cause an error:

/* :hover is not anchored with an a tag*/
.test :hover{
    top: 10px;

.test .event-link:hover {
    top: 10px;

The following pattern is considered okay and does not cause an error:

/* :hover is anchored with an a tag*/
.test a:hover{
    top: 10px;

.test a.event-link:hover {
    top: 10px;

Further reading

(bug report about un-anchored hovers in IE7 and IE8)

Something went wrong with that request. Please try again.