Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

change cursor on web page

I am trying to change cursor with .gif image. It will be shown on whole page not only one link. I made it like

body {
    cursor:url(Butterfly.gif);
}

it does not work. I have also .cur file. It works on IE but not on Firefox.

like image 855
Ercan Avatar asked Mar 16 '26 14:03

Ercan


2 Answers

You have to add a fallback, e.g.

body {
  cursor: url(Butterfly.gif), url(Butterfly.ani), auto;
  /*                                            ^^^^^^ 
                                                compulsory, according to CSS 2.1
   */
}

See https://developer.mozilla.org/en/Using_URL_values_for_the_cursor_property for detail.

like image 111
kennytm Avatar answered Mar 20 '26 00:03

kennytm


If you insist, you have to use the .cur file for the sake of Internet Explorer.

Internet Explorer up to and including version 8 only support URI values of type .CUR and .ANI. (The other listed browsers list have support for .CUR, .PNG, .GIF and .JPG but not .ANI .) Note also that the Windows operating system requires the image to be 32 x 32 pixels or smaller although the specifications do allow for larger sizes than this.

http://reference.sitepoint.com/css/cursor

Although I'd say don't use it at all.

like image 42
Yi Jiang Avatar answered Mar 19 '26 22:03

Yi Jiang



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!