I have a website and I want to display comments in a div. I tried to use an overflow scroll div but it overflowed on mobile devices. It does work on my computer What am I doing wrong?
Asked
Active
Viewed 1.6k times
4
-
Scrolls for me in Mobile Safari. Maybe post some code. – thingEvery Feb 28 '20 at 04:42
-
@thingEvery Strange cuz for me and my frirnds who use Android, it does not scroll. – kahveciderin Feb 28 '20 at 04:56
5 Answers
10
add this css code to your container with overflow scroll.
-webkit-overflow-scrolling: touch;

zaphkiel
- 140
- 1
- 2
-
-
-
#rightbox form { width: 500px; overflow: scroll; -webkit-overflow-scrolling: touch; } – zaphkiel Feb 28 '20 at 07:00
-
13
-
Works great in Chrome for Moto G5 Plus Android 8.1.0 (+1). – Jose Manuel Abarca Rodríguez Mar 06 '23 at 20:55
0
You can try it!
overflow-y: scroll !important;
-webkit-overflow-scrolling: touch;

Josef
- 2,869
- 2
- 22
- 23
0
overflow: scroll; // this property will work on mobile devices for scroll instead of ove

waqas chughtai
- 19
- 5
0
using -webkit-overflow-scrolling: touch;
is the correct solution but it invalid in react, next you would need to use WebkitOverflowScrolling: "touch"

Mohammad Ameer
- 49
- 2
- 7
0
How i solved that, i strugled a lot and finally i put in html css media query next code
@media screen and (max-width: 700px) {
html {
-ms-overflow-style: none;
/* IE and Edge */
scrollbar-width: none;
max-width: 100vw !important;
overflow: hidden !important;
overflow-y: auto !important;
}
html ::-webkit-scrollbar {
display: none;
}
}
Dont use -webkit-overflow-scrolling: touch; !
In yours case make similar media query for your div element and adjust values by yours requirements.
I hope will be helpfull.

Goran_Ilic_Ilke
- 812
- 12
- 16