Custom CSS cursor click point

后端 未结 4 446
借酒劲吻你
借酒劲吻你 2020-12-09 10:59

How can I give a custom click point to cursors created by cursor: url(theCursorUrl);? e.g. you\'re using a hand(grab) image for the cursor. But you want that t

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-09 11:10

    The basic syntax is as follows:

    cursor: url(image) [x y|auto];
    

    However there are a number of quirks to be aware of that make it quite tricky to work with cross-browser.

    The main one is that Internet Explorer requires the cursor to be in '.cur' format, while other browsers require it in standard image format (eg '.gif'). If you want to support all browsers, you will need to create both, and write browser-specific code.

    It apparently doesn't work at all in Opera.

    The Quirksmode site has full details of all the oddities to expect.

提交回复
热议问题