I imported another stylesheet using @import
in the main style sheet file. I would like the changes I have made in the @import
stylesheet to override th
If your second stylesheet uses the same selectors, then it should override the first without any problem.
CSS has a very strict order of precedence for determining which one should be used, but if all else is equal and two styles have exactly the same precedence level, then it will use the one which was specified last. This allows you to override a style simply by repeating the same selector later on.
The only exception to this is if the first style was specified as !important
. In this case, it is much harder to override it. Even specifying another style as !important
may not always work (I've seen cases where it worked in some browsers but not others).
So if the previous stylesheet used !important
then you may have problems overriding it. But if not, it should be fairly simple.