44

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.

Peter Bridger
  • 9,123
  • 14
  • 57
  • 89

3 Answers3

88

Just use a CSS rule:

* {
cursor: none;
}
Ivan
  • 34,531
  • 8
  • 55
  • 100
Eldar Djafarov
  • 23,327
  • 2
  • 33
  • 27
  • correct - but some browsers will still show the cursor if the document height is not filled / >100% .. – goddva Sep 01 '09 at 09:22
  • I'd heard talk about this, but was told it didn't work... it's a nice surprise it does :) – Peter Bridger Sep 01 '09 at 09:30
  • Works in chrome for me (version 6.0.472.63 on Mac OSX). – William Knight Oct 10 '10 at 17:57
  • Chrome 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 Jul 20 '11 at 03:40
  • 1
    Can'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) – Jeremy Feb 15 '12 at 11:23
13

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;
}
  • To get a set of public domain blank cursors (including .cur): http://pc.autons.net/stuff/blanks/ – Gilead Jul 21 '14 at 18:40
  • Worked for me. Couldn't retrieve the .cur file anywhere so here's another link; [Download blank.cur](https://drive.google.com/file/d/14CctT9tg3cTYx5QDaramFTeVsFW-krKX/view?usp=sharing) – Simon Somlai Dec 22 '17 at 15:43
  • You can find blank cursors here: https://web.archive.org/web/20120320085351/http://pc.autons.net/stuff/blanks/blank.zip – Stephan Apr 14 '20 at 15:49
2

Try using the CSS:

  #elementID{
     cursor: none;
  }
scragar
  • 6,764
  • 28
  • 36