CSS Question: If two different selectors apply to an element, who wins?
I know this shouldn\'t happen, but I want to tweak a legacy application, and the CSS is getti
CSS stands for Cascading Style Sheets. This means that rules apply to elements in a cascading way. It's perfectly normal that different selectors apply to an element. Thinks, for example, to the following:
The following rules would affect to the "foo" element:
.wrapper {
//some other rules
}
#foo {
// some more rules
}
.bar {
// some more rules
}
Rules for priorities can be found here.
I always advise to use the Firefox "firebug" plugin. It will show you exactly which properties are evaluated for a specific element and why, emphasizing overrides during the cascade.