Home > Software design >  how to highlight multiple text with multiple colors with in react JS
how to highlight multiple text with multiple colors with in react JS

Time:12-01

I want to make multiple texts with multiple colors like red, green, yellow something like that now it is working for only one color I need each text in a different color please help me here is the code enter image description here

CodePudding user response:

Can you please check below link, It have different class name based on this

I need dynamic all this array values comes to from on handelChaneg from the input box i need fist word into red, the second word into green third into green ["Aloe Vera", "and", "study"]

: https://codesandbox.io/s/charming-dirac-m3w8z2?file=/src/App.js

You will find different class name and then you can define the css based on the colour class name.

Please let me know if you have any question

  • Related