CSS: hover pseudo class selection definition and usage, hover pseudo
Definition and usage of the pseudo-class selector E: hover:
Sets the style of an element when it is hovering over it.
The E element can be selected using other selectors, such as class selector, id selector, and type selector.
Note: IE6 does not support this selector, but supports the hover of Element a, that is, it only supports the hover of element a selected by the Type selector.
Syntax structure:
E:hover{ Rules }
Browser support:
Internet Explorer supports this selector.
Firefox supports this selection character.
Google Chrome supports this selector.
Operabrowser supports this selector.
Instance code:
<! DOCTYPE html>
Use the type selector to set the style before the hyperlink access.
<! DOCTYPE html>
You can set the style of a hyperlink when its mouse is hovering over it by using the class selector and id selector. Not supported in IE6.
<! DOCTYPE html>
The above code can change the background color when hovering the cursor over the div. It also shows that the hover pseudo class not only links the scope to element.