Simple overflow: hidden; doesn't cut it for Chrome or Firefox. Using position: fixed; works, but since a side effect can make the screen jump when you close the modal.
This will hide the scroll bar for Chrome and FF
.modal-open { -moz-appearance: menuimage; } .modal-open::-webkit-scrollbar { width: 0 !important; }
However, this will disable the scrollbar; scrolling is still possible by pressing keys / text selection / touch gestures.
One possibility is to set the height of the elements inside the body to zero, for example, all divs
.modal-open div { height: 0px; }
source share