Check out example codes for "css html attribut". It will help you in understanding the concepts better.

Code Example 1

<div class='dynamic-color' data-assigned-color='red'>lorem ipsum</div>
<div class='dynamic-color' data-assigned-color='blue'>lorem ipsum</div>
<div class='dynamic-color' data-assigned-color='green'>lorem ipsum</div>

.dynamic-color {
    color: [data-assigned-color];
}

Learn ReactJs, React Native from akashmittal.com