Cursor Images

The cursor property can be used to change and control the appearance of the mouse cursor.

selector { cursor: value; }
- value - specifies the type of cursor to be displayed when pointing on an elemen.
In this table there are diferent types of values that you can use for cursor property (bellow you can see some code examples):

CSS Cursors

Example, three DIVs with diferent cursor type for each one.
<style type="text/css"><!--
#ex1 div {
 float: left;
 width: 30%;
 height: 35px;
 margin: 2px;
 border: 2px solid blue;
 text-align: center;
#idiv1 { cursor: pointer; }
#idiv2 { cursor: wait; }
#idiv3 { cursor: move; }

<div id="ex1">
 <div id="idiv1">Value - pointer</div>
 <div id="idiv2">Value - wait</div>
 <div id="idiv3">Value - move</div>
 <br style="clear:left;" />

- Demo (move the mouse over each cell).
Value - pointer
Value - wait
Value - move

Cursor Images

If you want a custom cursor, you can use an image for the mouse cursor appearance. The standard image type that can be used for cursor is the ".cur" format.
To create a .cur file, you need specialized imagery software. A freely available cursor editor is the JustCursors, you can use this software to edit /create static or animated cursors. To download it, click: Download JustCursors.
Once you have the ".cur" file, use this syntax in your style sheet:
selector { cursor: url('image.cur'), default; }
<style type="text/css"><!--
#ex2 {
 height: 89px;
 border: 2px solid blue;
 cursor: url('bluearrow.cur'), default;

<div id="ex2">Cursor Image, ".cur"</div>

Demo (place your mouse over the text bellow):
Cursor Image, ".cur"

• Internet Explorer can also use ".ani" files for cursor images.
• Modern browsers, like Mozilla Firefox, Google Chrome, can use PNG images for cursor.
You can find on the net various web sites with free ".ani" images, search for: "free download ani cursor images".
Once you have an image in ".ani" format, you can conver it in ".png", then use both files in "cursor" property to make your CSS style work cross-browsers. Just look on the net for: "free convert ani png online".
To add two image files (ANI and PNG) in "cursor" property, use this syntax:
selector { cursor: url('image.ani'), url('image.png'), default; }

Example, a cursor rose:
<style type="text/css"><!--
#ex3 {
 height: 89px;
 border: 2px solid blue;
 cursor: url('rosecursor.ani'), url('rosecursor.png'), default;

<div id="ex3">Cursor Images, ".ani" (for IE), and ".png" (for modern browsers).</div>

Demo (place your mouse over the text bellow):
Cursor Images, ".ani" (for IE), and ".png" (for modern browsers).

• Click: Cursor Images to download an archive with some ".cur" and ".ani" files that you can use to test the examples presented in this tutorial.

Path to the image file

If you add the CSS code into an external ".css" file, take into account the fact that Internet Explorer interprets relative URLs as relative to the HTML document, but modern browsers (Mozilla Firefox, Google Chrome) interpret relative URLs as relative to the ".css". So, in the code in ".css" add two "url" paths for ".cur" file, one relative to the ".css" file, and other "url" relative to the HTML document in which the ".css" file is included.
For example, if the ".cur" and ".css" files are in the same folder, named "styles", and the HTML document is in a directory above this CSS file, we'll use this code in the ".css" file:
  The CUR and CSS files are in the same folder, the HTML is in a directory above this CSS file

#id {
  cursor: url('bluearrow.cur'),             /* Modern browsers    */
          url('styles/bluearrow.cur'),      /* Internet Explorer  */
In this way, the style will work in all major browsers.

Daily Test with Code Example

Which tag defines the clickable areas inside the image map?
<map> <img> <area>
<img src="image.jpg" usemap="#map1">
<map name="map1">
  <area shape="rect" coords="9, 120, 56, 149" href="#">
  <area shape="rect" coords="100, 200, 156, 249" href="#">
Which CSS property defines what is done if the content in a box is too big for its defined space?
display overflow position
#id {
  overflow: auto;
Click on the event which is triggered when the mouse is positioned over an object.
onclick onmouseover onmouseout
document.getElementById("id").onmouseover = function(){
  document.write("Have Good Life");
Indicate the PHP variable that contains data added in URL address after the "?" character.
if(isset($_GET["id"])) {
  echo $_GET["id"];
CSS cursor property - Custom Cursors

Last accessed pages

  1. innerHTML in PHP (5012)
  2. Qwop (39689)
  3. Tic Tac Toe Note Paper (211)
  4. Various Games (2576)
  5. Download JavaScript resources (2996)

Popular pages this month

  1. Qwop (6864)
  2. Drag Racer V3 (4694)
  3. Bubbles3 (1916)
  4. List with All the Games (1605)
  5. Butterfly Kyodai (1507)