2018-10-04 14:47:55 +01:00
|
|
|
---
|
|
|
|
title: CSS Cursors
|
|
|
|
---
|
|
|
|
## CSS Cursors
|
|
|
|
|
2018-10-15 23:48:55 -05:00
|
|
|
The cursor property specifies the type of cursor to be displayed when you hover over an element. It has 39 possible values:
|
2018-10-04 14:47:55 +01:00
|
|
|
```css
|
2018-10-15 23:48:55 -05:00
|
|
|
.alias { cursor: alias; }
|
|
|
|
.all-scroll { cursor: all-scroll; }
|
2018-10-04 14:47:55 +01:00
|
|
|
.auto { cursor: auto; }
|
|
|
|
.cell { cursor: cell; }
|
2018-10-15 23:48:55 -05:00
|
|
|
.context-menu { cursor: context-menu; }
|
|
|
|
.col-resize { cursor: col-resize; }
|
2018-10-04 14:47:55 +01:00
|
|
|
.copy { cursor: copy; }
|
2018-10-15 23:48:55 -05:00
|
|
|
.crosshair { cursor: crosshair; }
|
|
|
|
.default { cursor: default; }
|
|
|
|
.e-resize { cursor: e-resize; }
|
|
|
|
.ew-resize { cursor: ew-resize; }
|
|
|
|
.grab { cursor: grab; }
|
|
|
|
.grabbing { cursor: grabbing; }
|
|
|
|
.help { cursor: help; }
|
2018-10-04 14:47:55 +01:00
|
|
|
.move { cursor: move; }
|
2018-10-15 23:48:55 -05:00
|
|
|
.n-resize { cursor: n-resize; }
|
|
|
|
.ne-resize { cursor: ne-resize; }
|
|
|
|
.nesw-resize { cursor: nesw-resize; }
|
|
|
|
.ns-resize { cursor: ns-resize; }
|
|
|
|
.nw-resize { cursor: nw-resize; }
|
|
|
|
.nwse-resize { cursor: nwse-resize; }
|
2018-10-04 14:47:55 +01:00
|
|
|
.no-drop { cursor: no-drop; }
|
2018-10-15 23:48:55 -05:00
|
|
|
.none { cursor: none; }
|
2018-10-04 14:47:55 +01:00
|
|
|
.not-allowed { cursor: not-allowed; }
|
2018-10-15 23:48:55 -05:00
|
|
|
.pointer { cursor: pointer; }
|
|
|
|
.progress { cursor: progress; }
|
2018-10-04 14:47:55 +01:00
|
|
|
.row-resize { cursor: row-resize; }
|
|
|
|
.s-resize { cursor: s-resize; }
|
|
|
|
.se-resize { cursor: se-resize; }
|
|
|
|
.sw-resize { cursor: sw-resize; }
|
2018-10-15 23:48:55 -05:00
|
|
|
.text { cursor: text; }
|
|
|
|
.vertical-text { cursor: vertical-text; }
|
|
|
|
.w-resize { cursor: w-resize; }
|
|
|
|
.wait { cursor: wait; }
|
|
|
|
.zoom-in { cursor: zoom-in; }
|
|
|
|
.zoom-out { cursor: zoom-out; }
|
|
|
|
.initial { cursor: initial; }
|
|
|
|
.inherit { cursor: inherit; }
|
|
|
|
```
|
2018-10-04 14:47:55 +01:00
|
|
|

|
|
|
|
|
2018-10-15 23:48:55 -05:00
|
|
|
You can also set an image as the cursor.
|
|
|
|
Note: Always specific a default cursor at the end incase the specified cursor is unavailable.
|
2018-10-04 14:47:55 +01:00
|
|
|
|
|
|
|
```
|
|
|
|
.custom-cursor {
|
2018-10-15 23:48:55 -05:00
|
|
|
cursor: url(cursor-image.png),auto;
|
2018-10-04 14:47:55 +01:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
#### More Information:
|
|
|
|
* Check the above cursor values in action: <a href='https://codepen.io/chriscoyier/pen/uCwfB' target='_blank' rel='nofollow'>codepen</a>
|
|
|
|
* Mozilla Developer Network: <a href='https://developer.mozilla.org/en-US/docs/Web/CSS/cursor' target='_blank' rel='nofollow'>MDN</a>
|
|
|
|
* Browser Support: <a href='http://caniuse.com/#search=cursor' target='_blank' rel='nofollow'>caniuse</a>
|
|
|
|
* Cursor examples by w3schools: <a href='https://www.w3schools.com/cssref/playit.asp?filename=playcss_cursor&preval=none' target='_blank' rel='nofollow'>w3schools</a>
|