Answer the question
In order to leave comments, you need to log in
How to distribute styles between elements?
Some data is coming from the database. There are 5 kinds of background colors for these elements. How can you do the following dynamically? Hope you understand what I mean.
.style-1 { bgc: red }
.style-2 { bgc: yellow }
.style3 { bgc: green }
<li className="style-1">First</li>
<li className="style-2">Second</li>
<li className="style-3">Third</li>
<li className="style-1">Fourth</li>
<li className="style-2">Fifth</li>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question