How to hide html horizontal but not vertical scrollbar?
How to hide html horizontal but not vertical scrollbar?
84
21-Jul-2023
Aryan Kumar
21-Jul-2023Sure, here is how you can hide the horizontal scrollbar in HTML but not the vertical scrollbar:
HTML
The
overflow-x: hidden
CSS property tells the browser to hide the horizontal scrollbar for the element with the classcontainer
. Theoverflow-y: visible
CSS property tells the browser to keep the vertical scrollbar visible for the element with the classcontainer
.This will hide the horizontal scrollbar for the container element, but will keep the vertical scrollbar visible.
Here is an example of how this would look in the browser:
The horizontal scrollbar is hidden, but the vertical scrollbar is still visible.