On the problem that css mask layers can be scrolled

wrote a css mask, which is similar to the effect of the bootstrap pop-up window

<div class="alert-container">
    <div class="alert-content"></div>
</div>

set the css of alert-container to

position: fixed;
background: rgba(0,0,0,0.70);
top: 0;
bottom: 0;
left: 0;
right: 0;

but the content under the background can be scrolled, and I don"t know how to solve the problem that can be scrolled in the following part

I wonder if there is a way not to use js

Mar.02,2021

  1. set overflow; for body when the mask is turned on
  2. $('body'). Css ("overflow", "hidden")

when the mask layer pops up, set the height of the visual area of the height: browser for body; and set the body: overflow:hidden; overflow hide; so that you can't scroll, and remove the style previously set by body when the mask layer is turned off;

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e47d33-44c53.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e47d33-44c53.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?