Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom Cursor Image CSS

I have a number of heroshot images, that have a modal popup when clicked. I'm trying to get my cursor to turn into magnifying glass whenever it is moved over the image. The following CSS does not appear to work even though my magnify.cur is present in the right location.

a.heroshot img {   cursor:url(/img/magnify.cur), pointer; } 

Has anyone ever done anything similar? I don't mind a JavaScript solution if one exists.

EDIT: It works in Safari, but not in Firefox.

like image 452
Chris J Allen Avatar asked Dec 03 '08 12:12

Chris J Allen


People also ask

How do I make an image a cursor in CSS?

Answer: Use the CSS cursor propertygif or . png (for Firefox, Chrome, Safari) and . cur for (for Internet Explorer). After that apply the cursor property with a comma-separated list of URLs pointing to these cursor images.


1 Answers

Your problem may be that cursor URLs don't work in Firefox for the Mac.

You can get the same effect on Firefox by using the -moz-zoom-in keyword.

cursor:url(/img/magnify.cur), -moz-zoom-in, auto; 

This will show magnify.cur, the Mozilla-specific zoom cursor or a system default cursor. The first cursor on the list that the browser supports is used.

You can also see a list of cursor keywords supported by different browsers.

like image 101
isani Avatar answered Sep 20 '22 14:09

isani