Join the Webstudio community

Updated 2 months ago

Dynamic Background Image or Color Using Binding

At a glance

The community members are discussing ways to have a dynamic background image or color using Binding. One community member suggests using an absolutely positioned Image component, while another suggests using custom JavaScript code to target the div and bind the background to a variable. The community members seem to agree that the JavaScript approach is a bit less convenient but will work, and the Image component will also optimize the image.

Anyone know a way to have dynamic background image or color using Binding
m
B
5 comments
cant see the purple dot
Attachments
Screenshot_2025-03-13_at_14.17.15.png
Screenshot_2025-03-13_at_14.16.16.png
You can use absolutely positioned Image component
thanks I will give this a try
what about using custom code javascript on the page to target the div and binding bg to a variable?
A bit less convenient but will work. Image will also optimize the image.
Add a reply
Sign up and join the conversation on Discord