To create a parent div with 100% width and a manually adjustable height at a specific breakpoint while ensuring an image fully covers the div with a gradient overlay, follow these steps:
1. Create the Parent Div
- Add a Div Block and set its Width to 100%.
- Set a default Height (e.g., 500px) and adjust the height manually per breakpoint:
- Switch to a smaller breakpoint (Tablet, Mobile).
- Manually change the Height under Style Panel > Size.
2. Add the Image Inside the Parent Div
- Drag an Image element inside the parent div.
- Set its Width to 100% and Height to 100%.
- Under Layout > Position, set it to Absolute, Full (this ensures it fills the parent div).
- Under Fit, choose Cover to maintain aspect ratio.
3. Add the Gradient Overlay
- Add another Div Block inside the parent div (above the image).
- Set its Width and Height to 100%.
- Apply Position: Absolute, Full so it covers the entire parent div.
- Set a Background Gradient with desired colors in the Style Panel.
- Adjust its Z-index (e.g., 1 or higher) to ensure it layers on top.
4. Adjust for Specific Breakpoints
- Switch to different breakpoints (Tablet, Mobile).
- Manually adjust the parent div's height only in those breakpoints for a custom look.
How to Learn These Webflow Concepts
To build a solid foundation in Webflow, focus on these key topics:
- Box Model Basics: Learn how divs, containers, padding, and margins work.
- Positioning and Display: Experiment with Flexbox, Grid, Absolute & Relative positioning.
- Breakpoints & Responsive Design: Adjust styles for different screen sizes in Webflow’s responsive controls.
- Webflow University: Visit Webflow University for in-depth tutorials.
- Practice!: Build UI components and analyze how Webflow structures them.
Summary
To achieve this setup, use a div with 100% width and a manually adjusted height, set an image to cover the div using Absolute positioning, and overlay a gradient div on top. Learn Webflow fundamentals through Webflow University, hands-on practice, and understanding CSS layout concepts.