In CSS, you can use the ":hover" selector and the cursor attribute to set the mouse hover to change the shape of the mouse. The ":hover" selector is used to select the element on which the mouse pointer is floating, and the cursor attribute is used to specify Mouse shape, the syntax is "element:hover{cursor:mouse shape;}".
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
How to set the mouse hover to change the mouse shape in css
In css, you can use cursor to set the mouse shape, and the cursor attribute stipulates that it should be displayed The type (shape) of the cursor.
Also: the hover selector is used to select the element on which the mouse pointer is floating.
Let’s take a look at the example below:
123
Output result:
When the attribute value of cursor is crosshair, The example is as follows:
123
Output result:
(Learning video sharing:css video tutorial)
The above is the detailed content of How to set mouse hover to change mouse shape in css. For more information, please follow other related articles on the PHP Chinese website!