2018-10-04 13:47:55 +00:00
|
|
|
---
|
|
|
|
title: CSS Cursors
|
|
|
|
---
|
|
|
|
## CSS Cursors
|
|
|
|
|
2018-10-16 04:48:55 +00: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-22 18:57:25 +00:00
|
|
|
|
|
|
|
• `cursor: alias;`<br>
|
|
|
|
• `cursor: all-scroll;`<br>
|
|
|
|
• `cursor: auto;`<br>
|
|
|
|
• `cursor: cell;`<br>
|
|
|
|
• `cursor: context-menu;`<br>
|
|
|
|
• `cursor: col-resize;`<br>
|
|
|
|
• `cursor: copy;`<br>
|
|
|
|
• `cursor: crosshair;`<br>
|
|
|
|
• `cursor: default;`<br>
|
|
|
|
• `cursor: e-resize;`<br>
|
|
|
|
• `cursor: ew-resize;`<br>
|
|
|
|
• `cursor: grab;`<br>
|
|
|
|
• `cursor: grabbing;`<br>
|
|
|
|
• `cursor: help;`<br>
|
|
|
|
• `cursor: move;`<br>
|
|
|
|
• `cursor: n-resize;`<br>
|
|
|
|
• `cursor: ne-resize;`<br>
|
|
|
|
• `cursor: nesw-resize;`<br>
|
|
|
|
• `cursor: ns-resize;`<br>
|
|
|
|
• `cursor: nw-resize ;`<br>
|
|
|
|
• `cursor: nwse-resize;`<br>
|
|
|
|
• `cursor: no-drop;`<br>
|
|
|
|
• `cursor: none;`<br>
|
|
|
|
• `cursor: not-allowed;`<br>
|
|
|
|
• `cursor: pointer;`<br>
|
|
|
|
• `cursor: progress;`<br>
|
|
|
|
• `cursor: row-resize;`<br>
|
|
|
|
• `cursor: s-resize;`<br>
|
|
|
|
• `cursor: se-resize;`<br>
|
|
|
|
• `cursor: sw-resize;`<br>
|
|
|
|
• `cursor: text;`<br>
|
|
|
|
• `cursor: vertical-text;`<br>
|
|
|
|
• `cursor: w-resize;`<br>
|
|
|
|
• `cursor: wait;`<br>
|
|
|
|
• `cursor: zoom-in;`<br>
|
|
|
|
• `cursor: zoom-out;`<br>
|
|
|
|
• `cursor: initial;`<br>
|
|
|
|
• `cursor: inherit;`
|
|
|
|
|
2018-10-04 13:47:55 +00:00
|
|
|
![alt text](http://www.javascripter.net/faq/24_cursor_styles.gif "CSS Cursors")
|
|
|
|
|
2018-10-22 18:57:25 +00:00
|
|
|
You can also set an image as the cursor.<br>
|
2018-10-16 04:48:55 +00:00
|
|
|
Note: Always specific a default cursor at the end incase the specified cursor is unavailable.
|
2018-10-04 13:47:55 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
.custom-cursor {
|
2018-10-22 18:57:25 +00:00
|
|
|
cursor: url(cursor-image.png), auto;
|
2018-10-04 13:47:55 +00: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>
|