'How do i make a custom cursor on html?

body { 
  cursor: url(cursor.png), auto;
}

I've tried to have it be as an external link, it did not work. I have also tried to add "" inside of the url with both an internal and external link and it did not work.

  • Image size is 840x859.
  • It's inside of <style> tag.
  • I use Visual Studio Code 2019


Solution 1:[1]

Try this:-

body {
    cursor: url('https://davidwalsh.name/demo/css-custom-cursor.ico'), default;
}
<h1>test</h1>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mohammad Sajid Choudhary