Webflow sync, pageviews & more.
NEW

Can I apply a transparent black color overlay to a CMS image in Webflow? I can only find the option to adjust opacity, but I prefer the image to be black instead of white.

TL;DR
  • Wrap the CMS image in a relatively positioned Div Block.
  • Add an absolutely positioned Div Block over the image with black background and reduced opacity.

Yes, you can apply a transparent black overlay to a CMS image in Webflow using a layered structure with absolute positioning.

1. Create Wrapper for the Image

  • Wrap the image in a Div Block. This will serve as the parent container that holds both the image and the overlay.
  • Set this wrapper Div position to "Relative". This allows child elements to be positioned absolutely within it.

2. Add the CMS Image

  • Inside the wrapper, add the Image element and connect it to your CMS image field.
  • Ensure the image width is set to 100% so it fills the container entirely.

3. Create the Black Overlay

  • Add another Div Block inside the wrapper, above or below the Image (order depends on layering).
  • Set its Position to “Absolute”, and set Top, Bottom, Left, and Right to 0 so it covers the entire parent wrapper.
  • Give it a Background color of black (#000000) and set the Opacity to your desired transparency (e.g., 50%).

4. Adjust Z-Index (If Needed)

  • Make sure the overlay Div has a higher Z-index than the Image (e.g., give the overlay Z-index 2 and the image 1) if layering doesn't work correctly.

5. Optional: Add Text or Other Content

  • You can also add text or icons on top of the overlay by placing them inside the parent wrapper with appropriate Z-index values.

Summary

To add a transparent black overlay on a CMS image in Webflow, place the image inside a Div Block wrapper, then layer a second absolutely-positioned Div with a black background and reduced opacity above it. This achieves the desired effect without altering the actual image.

Rate this answer

Other Webflow Questions