Search code examples
javascripthtmlcssmouse-cursor

Url cursor in a button


I have a cursor url and I want to change the cursor when it is on the button, I've tryed pointer, hover, url but it doesn't work can someone help me? Thanks.

<button id="btt" style="cursor:hover" type="button">

The url I have:

<style type="text/css">
    body, a:hover {
        cursor: url(http://cur.cursors-4u.net/games/gam-14/gam1379.ani), url(http://cur.cursors-4u.net/games/gam-14/gam1379.png), progress !important;
    }
</style>

Solution

  • Your code is applying the cursor image to <a> elements and not buttons.

    a:hover, button {
      cursor: url(http://cur.cursors-4u.net/games/gam-14/gam1379.ani), 
              url(http://cur.cursors-4u.net/games/gam-14/gam1379.png), 
              progress !important;
    }
    

    https://css-tricks.com/almanac/properties/c/cursor/