ionescho
ionescho

Reputation: 1400

Defining your own cursor not working in IE 8

this page works perfectly in Firefox and chrome but not in IE :

<html>
  <head>
    <style  rel="stylesheet" type="text/css" > 
      body{ 
        cursor: url("crosshair2nosprinkles.cur") 24 24, default;
      }
    </style>
  </head>
  <body>
  </body>
</html>

Upvotes: 0

Views: 2832

Answers (3)

ionescho
ionescho

Reputation: 1400

the answer was that IE didn't accept hotspot coords so i had to make myself a cursor with implicit hotspots and also i had to define the DOCTYPE at the beginning of the page

Upvotes: 1

Jon Adams
Jon Adams

Reputation: 25137

Custom cursor syntax is a little weird cross-browser. See the blog post Cross-browser custom CSS cursors for the quirks, and so you can figure out which ones you need to implement for whichever browsers you want to support.

Without seeing paths, or the full HTML code (because I assume you simplified the above), it might problems with your URL reference, since IE bases the cursor relative paths not on the location of the CSS, like most url() uses, but by the source element. Are you getting any 404 errors in some browsers but not others? The linked guide should be able to walk you through how to fix it. (Or you can give us more details from the code including paths, network requests and statuses, a live example link, etc. and we can help you.)

Upvotes: 2

Niet the Dark Absol
Niet the Dark Absol

Reputation: 324650

.cur files have the hotspot built-in, so you don't need to specify it explicitly. Try this:

cursor: url("crosshair2nosprinkles.cur"), default;

If that doesn't work properly, make sure the cursor filehas the hotspot correctly defined.

Upvotes: 4

Related Questions