| Version |
|---|
| CSS2 |
| IE7+ | FF1+ | SA1.3+ | OP9.2+ |
|---|---|---|---|
| Full | Full | Full | Full |
Syntax
Description
The
:hover pseudo-class matches any element that’s
being designated by a pointing device. The term
designated refers to the process during which the
cursor is hovered over the box generated by the
element.
Example
This rule will apply a border to any
img element over which the cursor is
hovered:
img:hover {
border: 5px solid #F2F2F2;
}
Compatibility
| Internet Explorer | Firefox | Safari | Opera | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| 5.5 | 6.0 | 7.0 | 1.0 | 1.5 | 2.0 | 1.3 | 2.0 | 3.0 | 9.2 | 9.5 |
| Buggy | Buggy | Full | Full | Full | Full | Full | Full | Full | Full | Full |
In Internet Explorer versions up to and including 6:
:hoveris applied only to HTMLaelements that have anhrefattribute.:hoveris counted as two classes/pseudo-classes in the specificity calculation.:hoveris ignored if it’s not in the last simple selector.
Neither Internet Explorer 5.5 nor 6 supports the chaining of pseudo-classes; only the last pseudo-class is honored in these browsers.
In Internet Explorer 7:
- The element sometimes remains in the hover state if the cursor is moved from the element while the mouse button is pressed; the hover state sometimes doesn’t apply when it should.
:hoverdoesn’t match elements with negativez-indexproperty values.
User-contributed notes
- ID:
- #3
- Date:
- Mon, 01 Sep 2008 10:53:12 GMT
- Status:
- This note has not yet been confirmed for accuracy and relevance.
As there are still major problems with :hover in IE7, it seems to me that your chart should read Buggy for IE7. The problems necessitate the use of the sfhover javascript hack for the popular Suckerfish menus with IE7, as well as IE6. Depressingly, this bug is also still present in IE8 beta 2.
- ID:
- #2
- Date:
- Thu, 07 Feb 2008 06:32:23 GMT
- Status:
- This note has not yet been confirmed for accuracy and relevance.
col:hover and colgroup:hover not supported
Add a note
To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.