Webflow sync, pageviews & more.
NEW

Are there any examples of simple responsive popup/modal windows with a close button that I can use on my Webflow site?

TL;DR
  • Create a fixed, full-screen Modal Wrapper div with hidden visibility and centered Flex layout.
  • Add a styled Modal Content div inside, along with a Close Modal button positioned absolutely.
  • Use Webflow’s interactions to show the modal on trigger click and hide it on close button click.
  • Ensure responsiveness with percentage-based widths and test across breakpoints.

You can create a simple, responsive popup/modal window with a close button in Webflow using native interactions and elements—no custom code required.

1. Create the Modal Wrapper

  • Add a new Div Block to your canvas and give it a class like Modal Wrapper.
  • Set the position to Fixed, top/left/right/bottom to 0, and z-index to a high value (e.g., 9999).
  • Set width and height to 100%.
  • Set display to Flex, align center and justify center.
  • Add a semi-transparent background color (e.g., rgba(0,0,0,0.6)).
  • Set visibility to Hidden and opacity to 0 (this will be controlled by interactions).

2. Create the Modal Content

  • Inside the Modal Wrapper, add another Div Block called something like Modal Content.
  • Set a max-width (e.g., 500px) and width to 90–100% for mobile responsiveness.
  • Add padding and a background color (typically white).
  • Optionally add rounded corners and box shadow for design.
  • Insert any content like text, images, buttons, or forms inside this div.

3. Add a Close Button

  • Inside the Modal Content, add a Button element or a Div Block with an X icon.
  • Position it using absolute positioning (e.g., top-right).
  • Name it something like Close Modal.

4. Set Up Interactions

  • Select the element that will trigger the modal to open (e.g., a “Subscribe” button).

  • Go to Interactions panel → Element Trigger → Mouse Click (Tap), and choose Start an Animation.

  • Create an animation that sets the Modal Wrapper to:

  • Display: Flex

  • Opacity: 100%

  • Transition Duration (e.g., 200ms)

  • Now, select the Close Modal button.

  • Add another click interaction to set the modal’s opacity back to 0 and visibility/display to Hidden/None after the fade.

5. Make It Responsive

  • Since you're using Flex layout for centering and setting widths in %, the modal will naturally adjust on different screen sizes.
  • Always test in Webflow’s preview mode using different breakpoints and on actual devices.

Summary

You can build a clean, responsive modal in Webflow by combining a fixed wrapper div, a content div, and click interactions to show and hide it. No custom code or third-party tools are needed—everything can be done natively in Webflow.

Rate this answer

Other Webflow Questions