Question

i want display vertical scrolling only to my site when used to see mobile view.I want remove the horizontal scrolling to my site when i used to see in mobile. i have long pages in mobile view vertical scrolling is not appearing.

help me.

Was it helpful?

Solution

I think that you can use @media query and overflow-x or overflow-y to control the scrollbars, so with that said you can combine this:

CSS

body {
  overflow: hidden;
}

@media (max-width: 480px) {
  body {
    overflow-y: auto;
  }
}

Adjust the 480px to meet your specific needs. Here is a fiddle that shows this query working when you resize the browser to lower than 480px you can see that the scrollbar comes back.

Let me know if this works for you. As you can see we have the overflow set to hidden on the body (as you have now) and with this @media query I can bring it back when the width is 480px or lower.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top