Spiegato, Home

Technology and Gadgets

What Is an HTML Cursor?

  • Published by Spiegato
  • 2 min read

A HyperText Markup Language (HTML) cursor refers to the appearance of the mouse pointer as it is represented on the screen. Although the cursor has a set of default appearances and behaviors that are controlled by both the operating system on a computer and the web-browsing program itself, these can both be changed within an HTML document. The change in the shape of a cursor can be purely for aesthetic or design purposes, or it can be to help emphasize the utility of a component of the website. In addition to being able to change the cursor to one of the system’s pre-defined forms, it also can be changed into a custom image. There are some problems with using an HTML cursor, however, most of them arising from incomplete browser implementations of the language or operating system restrictions.

The ability to modify the state and image of an HTML cursor was almost always a function that could be achieved online through the use of some very long and inconsistently performing scripts or plug-ins, but the introduction of the second version of Cascading Style Sheets (CSS) in HTML made the process much easier and far more consistent. By changing the document object model (DOM) cursor property, the cursor as it appears within the browser’s viewing window can be modified. The actual functionality of the mouse, so far as clicking and dragging, cannot be changed in this way.

The HTML cursor can be changed to any one of a number of pre-defined shapes. Most of these shapes are employed by the operating system during normal use and include the standard pointing arrow, crosshairs, a waiting icon or arrows used when resizing windows in different directions. There also is the ability to specify a custom image to be used in place of the cursor. To specify a customer HTML cursor, the image file must be no larger than 32 pixels in width and height. It also should be designed in a file format that allows transparency so parts of the website underneath unused sections of the cursor are visible, and so the cursor itself does not appear as a solid opaque block with an icon drawn into it.

Not all browsers implement all features in the same way, so changing an HTML cursor does not always have the same results. Some browsers support different names for different system cursors, while others require some code tweaking to get a custom HTML cursor to appear. Additionally, the operating system being used and the context in which the browser is running also can prevent the cursor from being changed.

Key terms in this article

Related articles

  • What Is HTML ASCII?

    The fonts frequently used in hypertext markup language (HTML) documents are largely based on the original character set established under the American…

  • What Are HTML Scripts?

    HyperText Markup Language (HTML) documents can contain pieces of programming code, or links to source code files, that are executed at different points…

  • What Is an HTML Database?

    A hypertext markup language (HTML) database is a program that can collect and display information over the Internet. This database software interfaces…

  • What Is HTML Programming?

    A programmer utilizes the syntax of hypertext markup language (HTML) to create a document through HTML programming that can be viewed as an Internet…

  • What Are HTML Background Codes?

    Background codes for HyperText Markup Language (HTML) are properties of block-level elements that can change the appearance of the area behind the…