Erik
Erik

Reputation: 14750

How to make possible vertical scroll on popup and disable vertical scroll for page by using CSS?

I'm developing responsive web site for small devices. I need to show popup (pure div) and make possible vertical scroll due large content. But instead scrolling my popup main page scrolled.

My question is how could I disable main page scroll and scroll only popup?

Upvotes: 6

Views: 33218

Answers (1)

nicael
nicael

Reputation: 18995

You can set height of your .popup and then set overflow to auto

.popup{
   height:50px;
   overflow:auto;
}

Now, if your popup has a large contents that doesn't fit in 50 pixels by height and you'll scroll on it, contents in popup will be scrolled instead of whole document contents.

Upvotes: 12

Related Questions