CSS Cursor

As you may well know, a cursor is the little pointer that moves around as you move your mouse around. You may also be aware that the cursor often changes its look, depending on what page element its hovering over. For example, if you hover over a hyperlink, the default behavior for cursors is to change into a pointer or a hand.

The CSS cursor property allows you to define the look of the cursor based on your own rules.

For example, you could make a CSS cursor change into a question mark when the user hovers over an element that displays a tooltip when clicked on. Another popular use of CSS cursors is forcing a pointer/hand to be displayed when hovering over a JavaScript "artificial" link. More specifically, a link that doesn't use the HTML <a> tag - such as some text with an onclick event handler. For this type of link, see JavaScript Links.

A word of caution. If not used carefully, CSS cursors have the ability to make drastically reduce usability of your website. Make sure that you only change the cursor when it really makes sense - like when building a custom interface using JavaScript or similar. Usually you'll find that HTML produces the most appropriate cursor for the occasion.

CSS Cursor Codes

Hover over each line of text below to see what the cursor looks like for that line.

Example -