Previous | Home | Next |
The cursor property of CSS allows you to specify the type of cursor that should be displayed to the user. One good usage of this property is in using images for submit buttons on forms. By default, when a cursor hovers over a link, the cursor changed from a pointer to a hand. For a submit button on a form this does not happen. Therefore, using the cursor property to change the cursor to a hand whenever someone hovers over an image that is a submit button. This provides a visual clue that they can click it.
- Auto: Shape of the cursor depends on the context area it is over. For example an I over text, a hand over a link, and so on...
- crosshair: A crosshair or plus sign
- default: An arrow.
- pointer: A pointing hand.
- Move: The I bar
- E-resize: The cursor indicates that an edge of a box is to be moved right (east)
- ne-resize: The cursor indicates that an edge of a box is to be moved up and right (north/east).
- nw-resize: The cursor indicates that an edge of a box is to be moved up and left (north/west).
- n-resize: The cursor indicates that an edge of a box is to be moved up (north).
- se-resize: The cursor indicates that an edge of a box is to be moved down and right (south/east).
- sw-resize: The cursor indicates that an edge of a box is to be moved down and left (south/west).
- s-resize: The cursor indicates that an edge of a box is to be moved down (south).
- w-resize: The cursor indicates that an edge of a box is to be moved left (west).
- Text: The I bar
- Wait: An hour glass
- Help: A question mark or balloon, ideal for use over help buttons.
.auto{ cursor:auto; }
.croshair{ cursor:crosshair; }
.default{ cursor:default; }
.pointer{ cursor:pointer; }
.move{ cursor:move; }
.e-resize{ cursor:e-resize; }
.ne-resize{ cursor:ne-resize; }
.nw-resize{ cursor:nw-resize; }
.n-resize{ cursor:n-resize; }
.se-resize{ cursor:se-resize; }
.sw-resize{ cursor:sw-resize; }
.s-resize{ cursor:s-resize; }
.w-resize{ cursor:w-resize; }
.text{ cursor:text; }
.wait{ cursor:wait; }
.help{ cursor:help; }
<html> <head> <style> .croshair{ cursor:crosshair; } .default{ cursor:default; } .auto{ cursor:auto; } .e-resize{ cursor:e-resize; } .help{ cursor:help; } .inherit{ cursor:inherit; } .move{ cursor:move; } .ne-resize{ cursor:ne-resize; } .n-resize{ cursor:n-resize; } .nw-resize{ cursor:nw-resize; } .pointer{ cursor:pointer; } .se-resize{ cursor:se-resize; } .s-resize{ cursor:s-resize; } .sw-resize{ cursor:sw-resize; } .text{ cursor:text; } .wait{ cursor:wait; } .w-resize{ cursor:w-resize; } </style> </head> <body> <p>This is display a different types of cursor properties</p> <p class="croshair">Crosshair</p> <p class="default">Default</p> <p class="auto">Auto</p> <p class="e-resize">E-resize</p> <p class="help">Help</p> <p class="inherit">Inherit</p> <p class="move">Move</p> <p class="ne-resize">Ne-resize</p> <p class="n-resize">N-resize</p> <p class="nw-resize">Nw-resize</p> <p class="pointer">Pointer</p> <p class="se-resize">Se-resize</p> <p class="s-resize">S-resize</p> <p class="sw-resize">Sw-resize</p> <p class="text">Text</p> <p class="wait">Wait</p> <p class="w-resize">W-resize</p> </body> </html>
Output
Previous | Home | Next |