# Custom Cursor

> Swaps the mouse pointer for custom SVG cursors inside an area, with a different one over links and a safe fallback.

- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: cursor, svg cursor, pointer, crosshair, hotspot, portfolio
- Live preview: https://copy-css.com/snippets/custom-cursor
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<div class="cursor-zone">
  <p>Move your mouse in here</p>
  <a href="#">and over this link</a>
</div>
```

## CSS

```css
.cursor-zone {
  display: grid;
  place-content: center;
  gap: 8px;
  width: 260px;
  height: 150px;
  border: 2px dashed #d6d3d1;
  border-radius: 16px;
  background: #fff;
  color: #57534e;
  font: 500 14px system-ui, sans-serif;
  text-align: center;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ccircle cx='16' cy='16' r='12' fill='none' stroke='%231c1917' stroke-width='2'/%3E%3Ccircle cx='16' cy='16' r='3' fill='%23ea580c'/%3E%3C/svg%3E") 16 16, crosshair;
}

.cursor-zone p {
  margin: 0;
}

.cursor-zone a {
  color: #ea580c;
  font-weight: 700;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ccircle cx='16' cy='16' r='14' fill='%23ea580c' fill-opacity='.85'/%3E%3Cpath d='M11 21 21 11M13 11h8v8' fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 16 16, pointer;
}

.cursor-zone a:focus-visible {
  outline: 2px solid #ea580c;
  outline-offset: 3px;
  border-radius: 2px;
}
```

## Notes

- This CSS Custom Cursor is 30 lines of pure CSS (1.0 KB) with no JavaScript and no dependencies. It uses CSS Grid and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
