I am trying to color code our work flow. Red is a customer that has not been serviced in 2 weeks. Yellow is a new ticket that has just been opened, but not assigned to an employee yet. Green is for a customer that has been assigned to an employee and is ready for work to begin. Yellow and Green are both defined in the database. Red class is set dynamically with javascript based on 2 weeks from last service date. The problem is that Red is over writing Yellow and Green. I need to make sure the red class is set before them rather than after. Any suggestions.
As was said before, the order in the attribute will have NO EFFECT, however you did have a TYPO ( forgetting to close the quotes).
As raplh suggested, adding the inline style attr (color:) will override any and all classes.
ALTERNATIVELY, since you said you were using JS anyway, you could TOGGLE the color class with JS so that only RED|YELLOW|GREEN is ever present at any given point. That would probably be the cleanest way to do it .
this is one of my scripts I use to toggle classes:
oh, incidentally as long as we are doing things properly your class names shouldnt really be named after color but semantic meanings; it will save a lot of headaches in the long run. consider using .urgent, .viewed, and .new as opposed to .red, .yellow, and .green