How do I make a Lightbox element float to the top left of its parent Container in Webflow without using absolute positioning?

TL;DR
  • Set the parent Container to Flex and configure Flexbox settings to "Row" with "Justify" and "Align" set to "Start".
  • Adjust the Lightbox element's margin if needed to eliminate unwanted spacing.

To make a Lightbox element float to the top left of its parent Container in Webflow without using absolute positioning, you can use CSS Flexbox properties.

1. Set the Parent Container to Flex

  • Select the Container that holds the Lightbox element.
  • In the Style panel, set the Display setting to Flex.

2. Configure Flexbox Settings

  • Set the Flex Direction to Row.
  • Set the Justify setting to Start to align items to the start (left) of the container.
  • Set the Align setting to Start to align items to the top of the container.

3. Adjust Lightbox Element Properties

  • Select the Lightbox element within the Container.
  • If necessary, adjust the Margin settings to ensure there is no unwanted spacing between the element and the Container.

Summary

By using CSS Flexbox, you can position the Lightbox element at the top left of its parent Container without absolute positioning. Adjust the container settings to Flex and align to Start both rows and columns.

Rate this answer

Other Webflow Questions