Enabling the Cursor Pointer
The cursor pointer is the mouse pointer shaped like a hand with pointing index finger. (The mouse pointer can vary from browser to browser.)
When the mouse cursor moves or hovers over a link, you see the pointer. It indicates something that is clickable.
Some clickable HTML elements do not provide the mouse pointer when hovered over.
Form buttons are an example. Checkbox and radio button labels are another example. As is the summary
element.
All of those and any other HTML elements can be told to display the pointer when the mouse cursor moves over it.
It is accomplished with the CSS cursor:pointer;
declaration.
Here is an example form button. If you are using a laptop or desk computer with a mouse, the mouse cursor will change to a pointer when you hover over the button.
Here is the code for the above button.
<input
type="button"
style="cursor:pointer;"
value="Test Button">
Now, let's illustrate the pointer with a checkbox and its label text. Move your mouse pointer over the example to see the effect.
This is the source code:
<label style="cursor:pointer;">
<input type="checkbox">
I'm in the other room.
</label>
One more example.
Summary of something
When you move your mouse cursor over the above summary line, the cursor changes to the pointer.
When hovering over the summary line, the mouse cursor changes to a pointer. Here is the source code.
<details style="border-left:3px solid #ccc; padding-left:6px;">
<summary style="cursor:pointer;">Summary of something</summary>
<p>
When you move your mouse cursor over the above summary line, the cursor changes to the pointer.
</p>
</details>
Those are just 3 examples. Any HTML element with content can be given the cursor:pointer;
style.
(This content first appeared in Possibilities newsletter.)
Will Bontrager