2.5. Other design techniques using the CSS style

2.5.1. Changing the cursor shape with CSS

It is sometimes useful to alter the browser’s environment. For example, you may want to change the browser’s cursor when the mouse passes over a given element. To change the shape of a cursor with CSS is easy: all you need is to define the style attribute with the cursor keyword. The following are the 16 frequently used cursor shapes defined in CSS1:

   cursor:auto         cursor:n-resize      cursor:crossbar      cursor:se-resize
   cursor:default      cursor:sw-resize     cursor:hand          cursor:s-resize
   cursor:move         cursor:w-resize      cursor:e-resize      cursor:text
   cursor:ne-resize    cursor:wait          cursor:nw-resize     cursor:help

Consider the following example page ex02-21.htm:

Example. ex02–21.htm ...

Get Practical Web Technologies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.