Let me start with a little disclaimer. Just because you can, doesn't mean you should use it. Hiding scrollbars can be bad for accessibility and user experience.
But there are rare cases where it makes sense, usually when you have scrolling effects or when modal is opened. So use it wisely.
Check the demo. And find the cross browser code below:
{
/* Firefox */
scrollbar-:;
/* IE 10+ */
:;
}
/* WebKit - Safari, Chrome, Opera */
{
:;
:;
}
Don't forget you can style scrollbars in webkit based browsers. Also you can use this code on any other element, not just body. Happy coding.
Comments (1)