Overflow-x: hidden doesn't work in Chrome

I applied this property to the elements: body and html , and yet Chrome will let me scroll along the x axis. I tested it in Safari and Firefox, and x-axis scrolling is disabled ...

Does anyone know what I am missing?

NB Using overflow: hidden works, but I want people to be able to scroll along the y axis.

Thanks!

+6
source share
3 answers

It seems that the problem no longer exists thanks to @Nelson specifying this. Here you can see the code that works correctly: http://jsfiddle.net/H84pr

+2
source

you can use

 html { overflow-x: hidden; }​ 
+4
source

I just ran into this problem when trying to hide some images that I / knew / would be wider than the body on a mobile device.

Initially, I simply had:

body { overflow-x: hidden; }

This does not work in Chrome, but it was in IE 10.

However, if you also added:

html { overflow-x: hidden; }

Images were correctly hidden in both browsers.

+3
source

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


All Articles