Back to article

CSS-Only Custom Cursor Demo

Move your mouse around to see the custom cursor. Hover over links and buttons to see the hover state.

Plain CSS Implementation

This demo uses the cursor: url() property with inline SVG data URIs. No JavaScript required.

Note: The cursor uses SVG data URIs embedded directly in CSS. In production, you'd typically use external image files (PNG or SVG) for better performance and caching.

Try hovering over these elements:

This is a link

Link as Button

How It Works

The CSS uses:

Accessibility

The demo includes a media query to disable custom cursors on touch devices:

@media (pointer: coarse) {
  body, a, button {
    cursor: auto;
  }
}

Production Tips