I am writing a style sheet to extend the base style sheet, in the CSS of which there are many pseudo-classes applied to certain elements. I would like my stylesheet to overlap some of these styles with a single style that applies to the element regardless of its state, whether it hangs, focuses, etc.
For example, a base stylesheet may have styles
.classname { color:#f00; } .classname:hover { color:#0f0; } .classname:active { color:#00f; }
but adding the following after these styles do not override pseudo-states ...
.classname { color:#fff; }
The following works, but it feels a lot of code for something that seems simple.
.classname, .classname:active, .classname:hover, .classname:focus, .classname:visited, .classname:valid{ color:#fff; }
Similarly, I know that !important will work, but this is usually a warning sign of a poorly structured style sheet.
Is there anything in the .classname:* lines that will cover all possible states, or somehow just delete all the pseudo classes?
source share