Sets the style of an a element when the user hovers the mouse pointer over the link.
dhtml语法
HTML |
[A]:hover { sRules } |
---|
Scripting | N/A |
---|
DHTML可能的值
sRules | String that specifies one or more Cascading Style Sheets (CSS) attribute/value pairs. |
Remarks
The default value of the :hover pseudo-class is browser-specific.
Hover means that the user has positioned the mouse pointer over the link but hasn't clicked or otherwise activated the element. If the user simply passes the mouse pointer over the link, the style does not change.
The :hover pseudo-class is often used with :active, :link and :visited, the pseudo-classes that affect the other states of a link.
DHTML代码范例
The following style rule sets the style of an anchor. When the user hovers the mouse pointer over a link to which the following style sheet has been applied, the text displays in red, converts to uppercase, and the characters are spaced 1 centimeter apart.
<STYLE>
A:hover { color:red; text-transform:uppercase; letter-spacing:1cm }
</STYLE>
是否符合公共标准
This pseudo-class is defined in
CSS, Level 2 (CSS2) .
Applies To