Web browser: Hide mouse cursor

84,881

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;
  }
Share:
84,881
Peter Bridger
Author by

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, 2022

Comments

  • Peter Bridger
    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
    goddva over 14 years
    correct - but some browsers will still show the cursor if the document height is not filled / >100% ..
  • Peter Bridger
    Peter Bridger over 14 years
    I'd heard talk about this, but was told it didn't work... it's a nice surprise it does :)
  • sudarshan
    sudarshan over 13 years
    Works in chrome for me (version 6.0.472.63 on Mac OSX).
  • Jeremy
    Jeremy almost 13 years
    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
    Jeremy about 12 years
    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)
  • Gilead
    Gilead almost 10 years
    To get a set of public domain blank cursors (including .cur): pc.autons.net/stuff/blanks
  • Simon Somlai
    Simon Somlai over 6 years
    Worked for me. Couldn't retrieve the .cur file anywhere so here's another link; Download blank.cur
  • Stephan
    Stephan about 4 years