-1

Possible Duplicate:
Custom Cursor Image CSS

Is there a way to change the default cursor images for your website when you use, for example..

body{
cursor:hand; /* Changing what 'hand' is equal to*/
}

So then I wouldn't have to use cursor:url() on everything and instead just change what the names equal to.

So for example I'd like to be able to.. hand = URL; progress = URL; etc etc.

Community
  • 1
  • 1
Jordan Richards
  • 532
  • 3
  • 18
  • A simple google search will reveal: http://www.w3schools.com/cssref/tryit.asp?filename=trycss_cursor – Florin Stingaciu Jul 31 '12 at 14:25
  • He doesn't want to change cursor type, but cursor graphic. – Anders Arpi Jul 31 '12 at 14:26
  • What I want to do is alter the cursor set. So whenever I use 'cursor: hand' it would use my graphic and not the default hand. @ Anders Holmström it is not at all a duplicate. – Jordan Richards Jul 31 '12 at 14:27
  • No, you can't change the cursor set other than by providing custom images for every element. – Christoph Jul 31 '12 at 14:30
  • Thanks Christoph, by custom image for every element do you mean by just cursor:url(blah) or (2 )editing what 'hand' is equal to? If it's (2) then that's what I'm looking for. If it's (1) then thanks anyway. – Jordan Richards Jul 31 '12 at 14:31

4 Answers4

0
body{
cursor: url('mycursor.cur');
}

however, cross browser functionality is limited. you should test...

Itai Sagi
  • 5,537
  • 12
  • 49
  • 73
0

You can't change the cursorset of the Operating-system. (Just imagine - What would you say as a visitor of such a website changing your system-settings). You also cannot redefine the appearance of the keywords.

You have to define custom-images if you want to do so. The best thing you could do is group elements you want to have the same cursor.

input, select, [elements,]*{
   cursor: url('someInputCursor.cur');
}
Christoph
  • 50,121
  • 21
  • 99
  • 128
0

You can't change cursor: hand; to use a different image. You could use a CSS pre-processor (e.g. LESS or SASS) to ease the task, e.g.

$hand: url('something.cur');
body {
    cursor: $hand;
}

Or perhaps use a class (or a selector that covers all necessary elements) and edit the HTML accordingly?

.customcursor {
    cursor: url('something.cur');
}
Olly Hodgson
  • 15,076
  • 3
  • 40
  • 60
0

No, you cannot, because the cursor property value keywords have their meanings defined in informal prose in CSS specs, with no tools for giving any instructions on how to implement them. The obvious intent is to leave the exact shapes implementation-dependent.

Using tools like LESS, you can write style sheet code that uses defined variables, but such code needs to be translated into CSS then.

Note that the hand keyword in non-conforming. The corresponding standard keyword is pointer. (People have used hand because IE 5 did not recognize pointer.)

Jukka K. Korpela
  • 195,524
  • 37
  • 270
  • 390