Skip to content

Instantly share code, notes, and snippets.

@dsdsdsdsdsds
Last active November 1, 2023 11:45
Show Gist options
  • Save dsdsdsdsdsds/bd142334efcd81f0b30e to your computer and use it in GitHub Desktop.
Save dsdsdsdsdsds/bd142334efcd81f0b30e to your computer and use it in GitHub Desktop.
CSS: Cross Browser hires/retina cursor image
.cursor {
cursor: url("cursor.png") 0 0, pointer; /* Legacy */
cursor: url("cursor.svg") 0 0, pointer; /* FF */
cursor: -webkit-image-set(url("cursor.png") 1x, url("[email protected]") 2x) 0 0, pointer; /* Webkit */
}
@aivarasbiliunas
Copy link

If you are using SVG be sure to set fixed height and width on SVG root node (recommended 32x32). Ref https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_User_Interface/Using_URL_values_for_the_cursor_property

@PhilSole
Copy link

@pugson, that's nothing compared to my 3 hours :'(

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment