Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Overflow-x:hidden not working in Chrome

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

Anyone know what I'm missing?

N.B. Using overflow: hidden works but I'd like people to be able to scroll on the y-axis.

Thanks!

like image 303
PapaSmurf Avatar asked Mar 02 '12 12:03

PapaSmurf


People also ask

Why does overflow hidden not work?

It is because you are using position absolute. You cannot use position absolute with overflow hidden, because position absolute moves the targeted element out of context with the document structure.

What does overflow-X hidden mean?

overflow-x: visible|hidden|scroll|auto|initial|inherit; Property Values: visible: This property does not clip the content. The content may be rendered outside the left and right edges. hidden: It is used to clip the content and no scrolling mechanism is provided.

Does overflow hidden work on mobile?

Viewed in a desktop browser, the black menu bar properly extends only to edge of the window, since the body has overflow-x:hidden . In any mobile browser, whether Android or iOS, the black menu bar displays its full width, which brings whitespace on the right of the page.


1 Answers

You can use

html { overflow-x: hidden; }​
like image 198
Jitender Avatar answered Sep 25 '22 11:09

Jitender