Hide/remove scrollbar from <body> but allow scrolling

GiS91 picture GiS91 · Oct 10, 2016 · Viewed 8.2k times · Source

As per the title, is there a way to hide/remove the scrollbar from body (not a div, but the entire body) and keep the 'scrollable property' enabled? I've been trying different solutions in these days but nothing really worked.

Thank you in advance!

Answer

wuzla picture wuzla · Mar 5, 2017

-webkit- solution from Fabian Schultz worked great, I added: -ms-overflow-style:none; to hide scrollbar on IE. Scroll enabled, scrollbar hidden.

This is the complete CSS:

::-webkit-scrollbar {
  display: none;
}

::-webkit-scrollbar-button {
  display: none;
}

body {
  -ms-overflow-style:none;
}