user1820022
user1820022

Reputation: 73

Disable body scrolling and leave inner div scrollable in mobile

How can you disable scrolling of the body of a webpage without also disabling the scrolling of sections of scrollable content within the window on a mobile device?

Upvotes: 0

Views: 177

Answers (1)

Simon Arnold
Simon Arnold

Reputation: 16157

If you simply want to disable the scrolling of the body, you can add in Css

body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

then nothing will scroll on your body, but your sections in your body with scrolling content will still be able to scroll.

Upvotes: 1

Related Questions