Using CSS How to enable vertical scroll in popup window ?

Question

Hey! I am trying to implement a popup window using  CSS that will show some list of content. But I am facing a problem with scrolling. The popup window working good. But when I putting numbers of content list index the overflow list items are hidden and I can’t scroll the window to see the list of content.

Now, what can I do to enable it either using CSS or Javascript snippet? Here is the pure CSS code that I tried without Javascript.

CSS:

.popbox {
  margin: 0 auto;
  width: 40%;
  background: rgba(255,255,255,0.2);
  padding: 32px;
  border: 2.5px solid #ffe;
  text-align: center;
  border-radius: 10px; 
}
.active {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  transition: opacity 450ms;
  opacity: 0;
  visibility: hidden;
}
.active:target {
  opacity: 1;
  visibility: visible;
}
.pop {
  margin: 72px auto;
  padding: 18px;
  background: #fff;
  border-radius: 6px;
  width: 30%;
  position: relative;
  transition: all 5s ease-in-out;
}

.popup h2 {
  margin-top: auto;
  color: #333;
  font-family: Tahoma, Arial, sans-serif;
}
.pop .close {
  position: absolute;
  top: 20px;
  right: 30px;
  transition: all 300ms;
  font-size: 28px;
  font-weight: bold;
  text-decoration: none;
  color: #333;
}
.pop .close:hover {
  color: #06D85F;
}
.pop .content {
  max-height: 30%;
 overfollow: hidden;
}
@media (max-width: 700px){
  .popbox{
    width: 70%;
  }
  .pop{
    width: 70%;
  }
}

HTML:

<div class="popbox">
	<a href="#popup1">Click to popup</a>
</div>

<div id="popup1" class="active">
	<div class="pop">
		<h2>popHeading</h2>
		<a class="close" href="#">&times;</a>
		<div class="content">
			List of Content 1
List of Content 2
List of Content 3
List of Content 4
..............
..............
..............
..............
..............
..............
..............
..............
..............
..............
..............
		</div>
	</div>
</div>

This code working well but I am unable to scroll vertically. 

Thank you.

Using CSS How to enable vertical scroll in popup window ?
4.5 (90%) 6 vote[s]

1
Jen Doggen 1 year 0 Answers 260 views Novice 0

Leave an answer

About Jen DoggenNovice