Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

html

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?

like image 941
Erik Avatar asked Nov 02 '14 21:11

Erik


1 Answers

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.

like image 52
nicael Avatar answered Sep 28 '22 00:09

nicael