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.

Source CodeResult

CSS Cursor: "auto"

CSS Cursor: "crosshair"

CSS Cursor: "default"

CSS Cursor: "hand" (Internet Explorer)

CSS Cursor: "pointer" (All other browsers, plus Internet Explorer 6)

CSS Cursor: "pointer" and "hand" (cross-browser)

CSS Cursor: "move"

CSS Cursor: "e-resize"

CSS Cursor: "ne-resize"

CSS Cursor: "nw-resize"

CSS Cursor: "n-resize"

CSS Cursor: "se-resize"

CSS Cursor: "sw-resize"

CSS Cursor: "s-resize"

CSS Cursor: "w-resize"

CSS Cursor: "text"

CSS Cursor: "wait"

CSS Cursor: "progress"

CSS Cursor: "help"

CSS Cursor: "url(cursor_move.gif),auto"

About the HTML Codes

The HTML code on this page is provided free of charge, for you to use however you wish. Feel free to modify the code to suit your own needs.

External Style Sheets

Most of the HTML codes on this website use inline CSS. If you intend to use the codes across your whole website, you should place the CSS into an external style sheet.

To learn more, check out this explanation of external style sheets.

Web Hosting

Our partner site, ZappyHost, is a professional web hosting company providing website hosting, domain names and related products. If you need web hosting, check them out!