Webflow sync, pageviews & more.
NEW

How can I put text over an image in Webflow? I adjusted the z-index of the text, but it still remains above the image. Is there another step I should take to achieve this?

TL;DR
  • Wrap the image and text in a Div Block set to position: relative.
  • Set the image to static or relative positioning, and the text to absolute with a higher z-index for proper overlay.

You're trying to place text over an image in Webflow, but adjusting z-index alone hasn't worked. This usually means a layout issue, not stacking order.

1. Place Both Elements Inside a Relative Parent

  • Wrap the image and text in a single Div Block (parent container).
  • Set this parent to position: relative. This allows absolutely positioned children to reference it.

2. Set the Image's Position to Static

  • Select the image and make sure its position is set to static or relative.
  • If the image is absolutely positioned on its own, it may not stack correctly with other elements.

3. Position the Text Absolutely

  • Select your text element (e.g., Heading or Paragraph).
  • Set its position to absolute, and align as needed (Top, Center, Bottom, etc.).
  • This lets the text float above the image inside the relative container.

4. Adjust Z-Index if Needed

  • Set the text’s z-index higher than the image — for example, text at z-index: 2, image at z-index: 1 (or leave image at auto).

5. Style and Align Text

  • Add padding, color, background, or text-shadow to ensure the text is readable over the image.
  • Use Flexbox on the parent container if you prefer overlay alignment without absolute positioning (set parent to display: flex, then align center both horizontally and vertically).

Summary

To overlay text on an image in Webflow: wrap both in a relative container, set the image to static or relative, and set the text to absolute with a higher z-index. Proper positioning depends on having the correct container structure and positioning rules.

Rate this answer

Other Webflow Questions