Webflow answer

Can I set a property for a component's section background image in Webflow? I have a header that I use on all my pages, but I want to change the background picture to match each page. Thank you.

Updated to match Webflow's current help pages.

TL;DR

  • Use component variants: give the section a different background image in each variant, then choose the variant on each instance of the header.
  • An Image property changes the image of an Image element, not a background set in the Style panel, so use it only if the picture can be an Image element inside the section.

Yes, with component variants. A section's background image is a style, and variants let each instance of a component use different styles. Component properties change content, such as the image in an Image element.

1. Use Component Variants for Background Images

  • Convert your header into a Component, if it isn’t already.
  • Edit the main component, then in the Navigator click the plus icon next to Variants and add a variant for each background (e.g., “About”, “Contact”).
  • With a variant selected, select the section and set its background image in the Style panel. Styles edited in a variant apply only to that variant; styles edited in the base variant are shared by all variants.
  • On each page, select the header instance and choose its variant from the Variants dropdown in the Props panel.
  • A component can have one variant property, with any number of variants. For more advanced cases, Webflow suggests the class custom attribute.

2. Or Use an Image Property on an Image Element

  • If the picture can be an Image element inside the section instead of a background, select it in the main component, click the purple dot next to the image in the Element settings panel and choose Create Image property.
  • You can also open the Properties panel from the left toolbar (or press K), add the property there and connect it to the element.
  • Then replace the image on each component instance in the right panel.

3. Avoid Duplicating Components

  • Don’t create multiple copies of the same component just to change the background—it makes maintenance harder.
  • Variants and component properties let you reuse a single component efficiently.

Summary

To change a background image per page in a reusable Webflow header component, create a component variant for each background and choose the variant on each instance. Use an Image property when the picture is an Image element rather than a background.

Other Webflow questions