I am trying use inline css in html content but it shows the error you see in the picture below; enter image description here

How can I use inline css in spfx webpart ?


1 Answer 1


Try it as below:

style={{"color" : "black"}}

If you want multiple attributes, try comma separated values as below:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.