To create a lightbox hover effect with text in Webflow, follow these steps:
1. Set Up the Lightbox
- Add a Lightbox element to your Webflow project.
- Inside the Lightbox, add a Div Block and set it to relative position.
- Inside this Div Block, add an Image that you want to showcase in the lightbox.
2. Add a Text Overlay
- Add another Div Block inside the Lightbox's Div Block.
- Set this new Div Block to:
- Absolute positioning (Full width & height of the parent).
- Background color with opacity (e.g., black at 50%).
- Flexbox (Center alignment) to align text in the middle.
- Inside this text overlay div, add a Text Block with the desired message.
- Select the text overlay div and set its opacity to 0% (hidden by default).
- Click on Interactions > Element Trigger > Mouse Hover and add a new animation:
- On Hover In: Set opacity to 100% (fade in effect).
- On Hover Out: Set opacity back to 0%.
- Adjust animation duration for a smooth transition.
4. Final Adjustments
- Ensure your overlay div is positioned above the image in the Z-index.
- Test the hover effect in Preview Mode.
- Publish and review responsiveness on different screen sizes.
Summary
You’ve created a lightbox hover effect with text by layering a text overlay div on top of an image within a Lightbox, then setting up hover-based opacity transitions.