Categories
CSS

How to hide the scroll bar on an HTML page with CSS?

Spread the love

Sometimes, we want to hide the scroll bar on an HTML page with CSS.

In this article, we’ll look at how to hide the scroll bar on an HTML page with CSS.

How to hide the scroll bar on an HTML page with CSS?

To hide the scroll bar on an HTML page with CSS, we select the scrollbar and hide it.

For instance, we write

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

to select the scrollbar for the element with ID element with #element::-webkit-scrollbar.

Then we hide it with display: none;.

Conclusion

To hide the scroll bar on an HTML page with CSS, we select the scrollbar and hide it.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *