Webflow sync, pageviews & more.
NEW

Are there any workarounds or tips to create long modal windows in Webflow that can be scrolled and have a fixed background with a semitransparent overlay?

TL;DR
  • Create a Fixed full-screen Div Block with a semi-transparent background and Flex Center alignment.
  • Add a scrollable Div Block inside with a Max Height (e.g., 80vh) and Overflow: Scroll.
  • Include a close button inside the modal and use Webflow Interactions to toggle Display: None/Flex.
  • Ensure smooth scrolling by setting modal content overflow to Auto while keeping the overlay fixed.

To create a long modal window in Webflow that supports scrolling while keeping a fixed, semi-transparent background overlay, follow these steps:

1. Create the Modal Structure

  • Add a Div Block and set it to Fixed position with Full (100vw, 100vh) width and height.
  • Set Background Color to a semi-transparent black (e.g., rgba(0, 0, 0, 0.5)).
  • Set Display to Flex (Align: Center, Justify: Center) to center the modal.

2. Design the Scrollable Modal Content

  • Inside the modal wrapper, add another Div Block for the modal content.
  • Set a Max Height (e.g., 80vh) and enable Overflow: Scroll to allow scrolling if the content is too long.
  • Add padding and a background color (e.g., white) for contrast.

3. Add Close Button

  • Insert a Button or Image inside the modal to serve as a close button.
  • Use Webflow Interactions to hide the modal when clicked.

4. Show/Hide Interactions

  • Set the modal Display: None by default.
  • Create an interaction on a button/link click to change it to Flex (or Block) when triggered.
  • Add a second interaction on the close button to revert to Display: None.

5. Ensure Smooth Scrolling

  • If content overflows, ensure the modal content's overflow is set to Auto so users can scroll naturally.

Summary

This method ensures that the overlay remains fixed, while the modal content scrolls independently when there's overflow. Webflow Interactions can toggle the modal's visibility dynamically.

Rate this answer

Other Webflow Questions