4

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?

kahveciderin
  • 312
  • 1
  • 3
  • 22

5 Answers5

10

add this css code to your container with overflow scroll.

-webkit-overflow-scrolling: touch;

zaphkiel
  • 140
  • 1
  • 2
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

0

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

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