How to show horizontal scroll bars only with CSS div element?

Spread the love

Sometimes, we want to show horizontal scroll bars only with CSS div element.

In this article, we’ll look at how to show horizontal scroll bars only with CSS div element.

How to show horizontal scroll bars only with CSS div element?

To show horizontal scroll bars only with CSS div element, we set overflow properties.

For instance, we write

div {
  overflow: auto;
  overflow-y: hidden;
}

to hide the vertical scrollbar with overflow-y: hidden;.

Conclusion

To show horizontal scroll bars only with CSS div element, we set overflow properties.

Leave a Reply

Your email address will not be published.