modal-open
class to the <body>
via Webflow interactions and set overflow: hidden
in CSS to lock background scrolling.position: fixed
and give the inner content a max-height
(e.g., 90vh
) with overflow: auto
to enable internal scrolling.To make your Webflow modal scrollable on small screens without allowing the background content to scroll, you need to control the overflow behavior correctly for both the modal and the body.
<body>
tag when the modal is open (e.g., modal-open
).<head>
or inside a page section), add this CSS rule:.modal-open { overflow: hidden; }
position: fixed; top: 0; left: 0; right: 0; bottom: 0;
.90vh
) and set overflow: auto or overflow-y: auto so it can scroll when needed.touch-action: none;
and -webkit-overflow-scrolling: auto;
to the modal-open
body class to reinforce the block.To create a scrollable modal on small screens without scrolling the background, lock the body scroll using a class like modal-open
, and enable scrolling inside the modal by setting a proper max-height and overflow: auto
. This ensures good usability while maintaining focus on the modal content.