How to change the cursor to an image when in the webpage(entirely) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to change the cursor to an image when in the webpage(entirely)

13th Mar 2022, 12:12 PM
Stesha Quarcoo
Stesha Quarcoo - avatar
3 Answers
+ 1
img { cursor: not-allowed; } cursor The cursor CSS property sets the mouse cursor, if any, to show when the mouse pointer is over an element. https://developer.mozilla.org/en-US/docs/Web/CSS/cursor
13th Mar 2022, 12:48 PM
SoloProg
SoloProg - avatar
+ 1
You can do it by the following code- body{ cursor: url("url here"), auto; } In the above code - url for the url of the image and auto are the coordinate you can also put two no. separated by comma like 0, 20 this is in the x, y form. it's in the body so that it is in the whole webpage you can also refer to this - https://developer.mozilla.org/en-US/docs/Web/CSS/cursor
13th Mar 2022, 12:50 PM
Shaurya Kushwaha
+ 1
Thanks a lot
13th Mar 2022, 2:49 PM
Stesha Quarcoo
Stesha Quarcoo - avatar