samedi 7 mars 2015

If i have 2 attributes on an element, which one will be displayed?

If for example an element has 2 classes, both with the color attribute, which one will be displayed?



<style>
.red {color:red}
.green{color:green}
</style>

<p class = "red green"> some text </p>


DWich color will the text be in this case? What is the rule here? Is it the order of classes in css, or in ? I couldn't figure out a rule in this case.





Aucun commentaire:

Enregistrer un commentaire