February 25, 2008

Have your cursor show the hand, not the arrow

By : Roy
Filed under : css

Hand Cursor

A friend of mine is working on some Javascript to show and hide divs based on what is clicked. He was using a link as the click-through, but was having a difficult time managing the behavior of the A tag when it came to the onclick event.

He decided he would rather use a different element type (such as SPAN) to use for the onclick activations. There was one problem though, he wanted the hand cursor to show when he hovered over the element instead of the default arrow cursor.

That can easily be fixed with some CSS!

Give the SPAN or other element you are trying to add the hand cursor to a class called “hand”.

In your CSS, use:

span.hand {cursor: pointer;}

Hover over this span to see the results

Tags : , , ,

No Comments

(required)
(will not be published) (required)
(opitional)