Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

css cursor url positioning

Tags:

css

I have some css like this:

cursor: url("x.gif"), move;

but the problem is that the image is not positioned right, I'd like to move it -15px up and left for example. Is this possible?

The center of a cursor: move; is the click point afaict and I'd like to use the center of my custom cursor image as well.

like image 865
erikvold Avatar asked Mar 15 '12 22:03

erikvold


1 Answers

Yes - just supply the hotspot coordinates:

cursor: url("x.gif") 15 15, move;

However bear in mind that this will break some browsers. Ideally, you need:

cursor: url("x.cur"), move;
cursor: url("x.gif") 15 15, move;

Where x.cur is a "proper" cursor file. If you need a program to make one, try RealWorld Cursor Editor.

like image 125
Niet the Dark Absol Avatar answered Oct 27 '22 02:10

Niet the Dark Absol