erikvold
erikvold

Reputation: 16538

css cursor url positioning

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.

Upvotes: 7

Views: 5183

Answers (1)

Niet the Dark Absol
Niet the Dark Absol

Reputation: 324750

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.

Upvotes: 16

Related Questions