13
My style sheets declare formatting for a class more or less like this:
.foo div label {
width: 100px !important;
}
This comes from a plugin. I would not like to change the plugin’s style sheets, but rather add my own sheets to overwrite the formats.
It turns out that in a certain case, I wish to have Labels with longer lengths. I tried something like:
.bar label {
width: 150px !important;
}
I thought this would be more specific and so it would be the formatting that would be worth at the end. I was wrong. If I overwrite with the entire selector, it will alter cases that I would like to leave intact. But my own statement will not overwrite the CSS of the specific case.
Is there any way to declare a formatting as more important than important? Something like:
.bar label {
width: 150px !important !urgent !emergency !runToTheHills;
}
The denotation
!important
takes precedence, but tries to apply the same in the same exact way:.foo div label {width:150px !important;}
to ensure a subscription to the first definition.– Zuul
@Zuul I wish to alter only a subset of mine Labels generated by the plugin. If I overwrite the entire selector, I will change all the Labels, not just a subset.
– Oralista de Sistemas
And kind:
.foo div label.sub-conjunto {width:150px !important;}
? The point is, to guarantee your subscription, you have to have a match to the initial statement. The way you’re asking the question there’s no such match as the plugin has a more specific path than yours.– Zuul
@Zuul was worth :D giving a class to the Abels solved the problem! That was the most illuminating comment I’ve seen in days :D
– Oralista de Sistemas
The idea of @Zuul is ideal and he should put an answer with it :) But in cases where this does not work, only in HTML, inline as I mentioned here: http://answall.com/questions/25311/para-que-serva-declares%C3%A7%C3%a3o-Important
– Sergio