Web browser: Hide mouse cursor
Solution 1
Just use a CSS rule:
* {
cursor: none;
}
Solution 2
Finding something that works across browsers is a pain.
The code below works on Chrome, IE, and Firefox. IE likes .cur files, Chrome likes the embedded png, and some browsers actually respect the none :)
#div {
cursor: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjbQg61aAAAADUlEQVQYV2P4//8/IwAI/QL/+TZZdwAAAABJRU5ErkJggg=='),
url(images/blank.cur),
none !important;
}
Solution 3
Try using the CSS:
#elementID{
cursor: none;
}
Peter Bridger
Technical Architect at Zone (https://www.thisiszone.com/) instilling the benefits of TDD and SOLID within the teams I run and using Scrum and a Continuous Delivery pipeline to continuously deliver high quality software
Updated on July 09, 2022Comments
-
Peter Bridger almost 2 years
Is it possible to hide the mouse cursor in a web browser?
I've done this in Flash for a touch screen application, where a mouse cursor is distracting and unneeded. This time it's for a display screen that is non-interactive, so a mouse cursor is not needed.
My gut feeling is there's no easy way to achieve this in the web browser, only by use of a browser plug-in.
The browser in use is Firefox, so perhaps there's a plug-in that achieves this? Although it would be preferable to be able to do this via JavaScript/jQuery.
-
goddva over 14 yearscorrect - but some browsers will still show the cursor if the document height is not filled / >100% ..
-
Peter Bridger over 14 yearsI'd heard talk about this, but was told it didn't work... it's a nice surprise it does :)
-
sudarshan over 13 yearsWorks in chrome for me (version 6.0.472.63 on Mac OSX).
-
Jeremy almost 13 yearsChrome in Kiosk (full screen with no borders) mode (version 12.0.742.122, windows xp sp3) and with window maximized seem to ignore BODY {cursor: none} and * {cursor: none} -- maybe I misunderstood the answer though.
-
Jeremy about 12 yearsCan't edit my last comment (too old?). Chrome in Kiosk mode with * {cursor: none} in css will remove the cursor. (version 16.0.912.77 m, on xp sp3)
-
Gilead almost 10 yearsTo get a set of public domain blank cursors (including .cur): pc.autons.net/stuff/blanks
-
Simon Somlai over 6 yearsWorked for me. Couldn't retrieve the .cur file anywhere so here's another link; Download blank.cur
-
Stephan about 4 yearsYou can find blank cursors here: web.archive.org/web/20120320085351/http://pc.autons.net/stuff/…