How to Hide Scrollbar in CSS Without Disabling Scroll?

css

To hide the scrollbar in CSS without disabling scroll, you can use the following code:

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

This will hide the scrollbar for webkit-based browsers such as Google Chrome and Safari.

For other browsers, you can use the following code:

html {
  scrollbar-width: none;
}

This will hide the scrollbar for all browsers except for webkit-based ones.

Keep in mind that hiding the scrollbar can have a negative impact on user experience, as it may make it difficult for users to know how much content is left to scroll through.

Latest Questions

css How to Set Distance Between Flexbox Items in CSS? css How to Center a Column Using Bootstrap 3? css How to Change the Color of an SVG Element in CSS?