title: How to disable background scroll on pop-up?
body: <p>I'm new to the web development world and wanted to know if there is a way to disable background scrolling.</p>
  <p>I've tried z-index for the pop-up to display above all the elements, but some background content was getting overlapped with the pop-up.</p>
  <p>I'm not much familiar with JS but was not able to get any help.</p>
  <p>Below please find my code</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>body {
    height: 200vh;
  }
  .bg-noscroll {
    
  }
  .overlay {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    transition: opacity 500ms;
    visibility: hidden;
    opacity: 0;
  }
  .overlay:target {
    visibility: visible;
    opacity: 1;
  }
  
  .popup {
    transform: translateY(-60px);
    margin: 70px auto;
    padding: 20px;
    background: #fff;
    border-radius: 5px;
    width: 30%;
    position: relative;
    transition: all 5s ease-in-out;
  }
  
  
  .popup .close {
    position: absolute;
    top: 20px;
    right: 30px;
    transition: all 200ms;
    font-size: 30px;
    font-weight: bold;
    text-decoration: none;
    color: #333;
  }
  .content {
    height: 250px;
  }
  .popup .content {
    overflow-y: scroll;
  }
  
  @media screen and (max-width: 700px){
    .popup{
      width: 70%;
   }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;body class="bg-noscroll bg-scroll"&gt; 
  &lt;span&gt;&lt;a class="popupBG-Disable" href="#popup"&gt;Full Recipe&lt;/a&gt;&lt;/span&gt;
            &lt;div id="popup" class="overlay"&gt;
      &lt;div class="popup"&gt;
          &lt;h3&gt;Foxtail Millet Porridge:&lt;/h3&gt;
          &lt;a class="close" href="#"&gt;×&lt;/a&gt;
          &lt;div class="content"&gt;
              &lt;span&gt;Ingredients:&lt;br&gt;here are some things that you'd use to make this&lt;br&gt; isn't this amazing?&lt;br&gt;Yes, it is!&lt;br&gt;
                this is getting loooooong&lt;br&gt;this will take me a while!&lt;br&gt;oh... yes it will&lt;br&gt;we're getting close&lt;br&gt;and we should be there                &lt;br&gt;or not...&lt;br&gt;Im losing hope&lt;br&gt;and patience&lt;br&gt;with how long this is taking&lt;br&gt;I could really cry&lt;br&gt;
                 but we'll get there soon&lt;br&gt;safe and sound&lt;br&gt;free as pie&lt;br&gt;I dont know what I meant by that&lt;br&gt;
                 this is taking long mannnn&lt;br&gt;
              &lt;/span&gt;
       </code></pre>
  </div>
  </div>
  </p>
  <p>Thank you for your help!</p>