cursor Attribute | cursor Property

DHTML, HTML, & CSS

cursor Attribute | cursor Property


Sets or retrieves the type of cursor to display as the mouse pointer moves over the object.

Syntax

HTML{ cursor: sCursor }
Scriptingobject.style.cursor [ = sCursor ]

Possible Values

sCursor String that specifies one of the following values:
autoBrowser determines which cursor to display based on the current context.
crosshairSimple cross hair.
defaultPlatform-dependent default cursor (usually an arrow).
handHand.
moveCrossed arrows indicating something is to be moved.
*-resizeArrow indicating edge is to be moved (*may be n, ne, nw, s, se, sw, e, or w—each representing a compass direction).
textEditable text (usually an I-bar).
waitHourglass or watch indicating that the program is busy and the user should wait.
helpArrow with question mark indicating Help is available.

The property is read/write with a default value of auto; the cascading style sheets (CSS) attribute is inherited.

Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see dynamic propertiesInternet Link.

Example

The following examples use the cursor attribute and the cursor property to change the cursor as it passes over an object.

This example uses a call to an embedded (global) style sheet to set the cursor to hand as the cursor passes over all paragraphs.

Sample Code

<STYLE>
    P { cursor:hand }
</STYLE>

This feature requires Internet Explorer 4.0 or later. Click the icon below to install the latest version. Then reload this page to view the sample.
Microsoft Internet Explorer

This example uses inline scripting to set the cursor to hand as the cursor passes over the paragraph.

<P onmouseover="this.style.cursor='hand'">

This feature requires Internet Explorer 4.0 or later. Click the icon below to install the latest version. Then reload this page to view the sample.
Microsoft Internet Explorer

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
Version data is listed when the mouse hovers over a link, or the link has focus.
A, ADDRESS, APPLET, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, currentStyle, custom, DD, DFN, DIR, DIV, DL, DT, EM, EMBED, FIELDSET, FORM, Hn, HR, HTML, I, IFRAME, IMG, INPUT type=button, INPUT type=checkbox, INPUT type=file, INPUT type=image, INPUT type=password, INPUT type=radio, INPUT type=reset, INPUT type=submit, INPUT type=text, KBD, LABEL, LEGEND, LI, LISTING, MARQUEE, MENU, OBJECT, OL, P, PLAINTEXT, PRE, runtimeStyle, S, SAMP, SMALL, SPAN, STRIKE, STRONG, style, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TR, TT, U, UL, VAR, XMP

Back to topBack to top

Did you find this topic useful? Suggestions for other topics? write us!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.