Can you overflow an HTML element only vertically?

Is it possible to set a to add a scroll bar vertically, but click horizontally?

EDIT I see a mention in CSS3 in the answers. Which browsers support this?

+3
source share
4 answers
html { overflow-x:hidden; overflow-y:auto; }

or { overflow-y:scroll; }

Not tested, but try.

+6
source
overflow: auto;     /* For CSS 2 user agents */
overflow-x: hidden; /* For UAs implementing the CSS 3 property */
+3
source

Yes.

overflow-y: auto;
overflow-x: hidden;
+2
source

To scroll horizontally:

overflow-x: auto;

To scroll vertically:

overflow-y: auto;
0
source

Source: https://habr.com/ru/post/1749954/


All Articles