CSS cursor customization

后端 未结 3 1806
遥遥无期
遥遥无期 2020-12-12 03:53

I\'m trying to make a CSS code that changes the cursor to a picture file when the cursor is on a webpage. I\'ve seen sites that give you a simple code to do it but they alwa

相关标签:
3条回答
  • 2020-12-12 04:04

    CSS:

    html{
      cursor: url(URL of pictures)
    }
    

    Other Simples:
    http://www.html1.freeiz.com/Your_cursor.html
    http://jsfiddle.net/wNKcU/5/
    http://jsfiddle.net/wNKcU/788/

    0 讨论(0)
  • 2020-12-12 04:04

    create an HTML element with the cursor image you want and use javascript's onmousemove event to move the cursor.
    window.onmousemove= function(e) {cursor.left=e.x;cursor.top=e.y;} //cursor is the HTML element

    0 讨论(0)
  • 2020-12-12 04:24

    Yes, simply apply the following css code to your body tag (assuming you want effect for whole page):

    body {
        cursor: url('URL to image');
    }
    

    Further information:
    The image file must be 32x32 or smaller
    Internet explorer only supports .cur files

    0 讨论(0)
提交回复
热议问题