CSS Precedance

I have three css files included in a page for examply aaa.css,bbb.css and ccc.css. it is following the order like aaa,bbb and then ccc, but I need to write something in the page so that bbb.css will be having more precedance then ccc.css. I cant use !important as it may effect whole website, I cant alter the order as it may effect other component. If you have any other solution, please let me know.

Hi onlymukti4u!

You can add weight to the specificity of the selector to override after coming rules.

Check the SitePoint Reference how to calculate specificity.

As Erik said you would have to add extra weight to all conflicting rules in bbb.css if you want them to over-ride what comes after (or indeed what went before if former rules have higher specificity).

It doesn’t sound a very logical thing to do unless you just mean to target one specific element.