does the order of styles matter?

If the rules are equal in specificity (in this case they are), individual rules get overridden in the order they’re defined in the CSS, so in your example red wins because it comes later in the CSS definitions. The same rule applies in other cases as well, for example:

<div class="red green">

Which of these wins?

.green { color: green; }
.red { color: red; }

.red wins here, it doesn’t matter the order in the class attribute, all that matters is the order the styles are defined in the CSS itself.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)