Forum Discussion
Fabian Ackeret
Oct 15, 2018Copper Contributor
SPFx Webpart: Reference images in css?
Hey there
I'm very new to SPFx webpart development and I'm just trying a few things.
How do you correctly reference images in css? E.g. background-images.
I created a property where the user can add a URL to that background image, but I don't know how to access those properties within css.
Does anyone know how to achieve this?
Hi Fabian
You could use the property value on the React code (not CSS) and create that specific style there.
See an example here: https://reactjs.org/docs/dom-elements.html#style
hope this helps
Hi Fabian
You could use the property value on the React code (not CSS) and create that specific style there.
See an example here: https://reactjs.org/docs/dom-elements.html#style
hope this helps
- Fabian AckeretCopper Contributorthanks :-)