How to control priority of class specification

wpoulos51

New Member
I have some DOM elements that have classes \[code\]foo\[/code\] and \[code\]bar\[/code\]:\[code\]<div class="foo bar">...</div>\[/code\]and I want to control the priority between them. Following the w3c specification on this, I thought that adding extra selectors to the css might make the priority higher. For example, if I wanted \[code\]foo\[/code\] to override \[code\]bar\[/code\], I was thinking of putting a \[code\]dummy\[/code\] class like this:\[code\].foo, .dummy{ ...}.bar{ ...}\[/code\]Will this work? Is there a better way to do this? I know that \[code\]!important\[/code\] can control individual attributes, but I want a more general solution that controls the priority of the entire class specification.
 
Back
Top