Log in

View Full Version : !important in reverse?



CCH
06-16-2011, 02:55 PM
I'm curious if there is a way to make it so that inline CSS is only used if there is no other CSS defined.

Normally I know that you'd just put !important on the external CSS or header CSS, but in my situation, this will be used in a forum environment where each skin uses its own type of CSS, which I don't have access to edit.

My goal would be to allow users to make a frame that has a header that will look like it fits no matter the theme they use, by inheriting the CSS of that theme. Most of the themes use standard classes, so it's no big deal there, but I'd like to be able to make a sort of "fall back" effect where if the class doesn't exist or is missing properties, the inline CSS will take effect instead.
Is there a way to either force the CSS applied by class to override the inline styling, or somehow make the inline style be ignored if another style is already specified? I'd prefer to avoid using JS to go searching to see if a property is already defined or not.