hover Pseudo-class

DHTML, HTML, & CSS

 
Click to return to the DHTML, HTML & CSS home page    
hostname Property     href Property     DHTML Properties    

hover Pseudo-class


Sets the style of the anchor when the user hovers the mouse over the links.

Syntax

HTML[A]:hover { attribute1:parameter1 [; attribute2:parameter2 [; . . .]] }
ScriptingN/A

Possible Values

attributeAny attribute applicable to text.
parameterAny of the range of values available to the corresponding attribute.

The default value is browser-specific.

Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see dynamic propertiesInternet Link.

Remarks

Hover means that the user has the mouse positioned over the link and has hesitated. If the user simply passes the mouse over the link, the style does change. The hover pseudo-class is often used with specific styles for the other states of a link: active, link, and visited.

Using pseudo-classes on objects other than the A object has no effect.

The syntax in the following example uses a colon (:) to specify a pseudo-class.

Example

This example sets the style of an anchor. When the user hovers the mouse over a hyperlink to which the following style sheet has been applied, the text displays in red, converts to uppercase, and is spaced 1 centimeter apart.

Sample Code

<STYLE>
    A:hover { color:red; text-transform:uppercase; letter-spacing:1cm }
</STYLE>

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
Version data is listed when the mouse hovers over a link, or the link has focus.
A

See Also

active, link, visited


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? write us!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.