Best way to do a div with specific background-color?

I need to create a div with specific background-color depending on variable object.

My options are:

  1. Create an infinite css for each color.
  2. Style in-line.

I know style should be separated from html. But, in this case, what is more efficient?

Source: html

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.