Oct 15 2018 02:51 AM
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?
Oct 15 2018 04:37 AM - edited Oct 15 2018 04:38 AM
SolutionHi 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
Oct 15 2018 04:37 AM - edited Oct 15 2018 04:38 AM
SolutionHi 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