How to set mouse hover to change mouse shape in css

WBOY
Release: 2021-11-29 10:56:07
Original
9424 people have browsed it

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;}".

How to set mouse hover to change mouse shape in css

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  
  
Copy after login

Output result:

How to set mouse hover to change mouse shape in css

When the attribute value of cursor is crosshair, The example is as follows:

      123  
  
Copy after login

Output result:

How to set mouse hover to change mouse shape in css

(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!

Related labels:
css
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!