DEV Community

cenimstar
cenimstar

Posted on

scrollbar

how to hide the scrollbar but keep the scroll function?

Top comments (2)

Collapse
 
juanctorresf profile image
Juan C • Edited
/* Hide scrollbar for Chrome, Safari, and Opera */
::-webkit-scrollbar {
  width: 0.5em; /* You can adjust the width if needed */
}

::-webkit-scrollbar-thumb {
  background-color: transparent; /* Make the thumb transparent */
}

/* Hide scrollbar for Firefox */
html {
  scrollbar-width: thin;
}

body {
  scrollbar-color: transparent transparent; /* Make the thumb transparent */
}

/* Optional: You can add styles for other browsers if needed */
Enter fullscreen mode Exit fullscreen mode
Collapse
 
cenimstar profile image
cenimstar

thank u!