简体   繁体   中英

How to add Cursor in Website using css?

I want to add Custom set of cursor on my website. How can i add a set of Cursors in Website using css/html/js ? So , Default mouse pointer is different, when i hover hyperlink its diff,,.. n so on. I need help with css code. I have the Set of Pointers including both .ani & .cur required for my site. I have already tried :-

These codes in my style.css

body, a:hover {cursor: url(cursor/blue.cur), progress !important;} 

Still no luck ! I have a master page and what I want is to assign a default custom cursor to the page and have all links use another custom cursor

Is this possible?

With css you can do that:

body {cursor: URL(imageFileUrl);}

If you need more information read this .

EDIT: This worked for me: <body style="cursor: url('cursor.jpg'), default">

The imagen that I've used is a jpg 32x32.

<script>
document.getElementsByTagName("body")[0].style.cursor = "url('cursor/blue.cur'), auto";
</script>

this must work IE 6+

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM