3 ms·
The sequence of lines has very little bearing on execution sequence. Maybe I misunderstood what you said, bet sequence is important. When two separate rules
by rimantas 17y ago
The sequence of lines has very little bearing on execution
sequence.
Maybe I misunderstood what you said, bet sequence is important. When two separate rules (with the same specificity) match an element, the last one wins. There is a reason why devs learn LoVe-HAte mnemonics.
For those who don't know it helps to remember the order of CSS rules for links: a:link, a:visited, a:hover, a:active. A:focus is getting more use recently, so usually it is stuck betveen V and H.
- ra 17y agoYou are correct, that's why I said 'very little bearing' rather than 'no bearing'. In practice, most of the time specificity is all that matters. I try to avoid 'last one wins' situations as they often mean you have written redundant CSS, hence making CSS harder to read :-)