Yes, it's entirely possible in Webflow to have a background image set to "cover" within a div that uses "overflow: hidden", and for the image to dynamically crop to the center based on its proportions.
Here’s how to configure it:
1. Structure Your Elements
- Place a Div Block (let's call it Wrapper Div) where you want the background image.
- Inside the Wrapper Div, add another Div Block (let’s call it Background Div) where the background image will be applied.
2. Set Up the Wrapper Div
- Set a fixed width and height, or allow it to adjust with relative units like
%
, vw
, or vh
, depending on your layout needs. - Set
overflow
to hidden
to crop content that overflows the Wrapper Div.
- Set Position to
absolute
with top: 0, bottom: 0, left: 0, right: 0 to make it cover the entire Wrapper Div. - Set
z-index
to -1 if needed, to place it behind any foreground content. - Apply your background image directly to this Div.
4. Apply Background Properties
- In the Style Panel, set:
- Background Image: Choose your image
- Background Size: Cover
- Background Position: Center Center
- Background Repeat: No Repeat
This configuration ensures:
- The image fills the available area while maintaining aspect ratio.
- Cropping occurs equally from the top/bottom or sides depending on the image proportions.
- The image is always centered, so you don't show blank spaces around it.
- Any overflow beyond the wrapper is hidden properly.
Alternative: Use One Div Only
If you don't need inner content, you can apply all settings directly to a single Div:
- Set fixed dimensions + overflow: hidden
- Set the background image with
cover
and center center
Summary
Yes, using background-size: cover, background-position: center, and overflow: hidden on a containing div, you can crop any image proportionally and center it within a div in Webflow—no custom code required.