Jump to content

How to overwrite !important CSS value with a more !important statement?


Recommended Posts

Assume I load a web page from an external server (which is not under my control) which contains a CSS with a !important statement for a lets say "file-size. attribute".

Now I want to overwrite this CSS statement with my own value e.g. by using Greasemonkey AddOn in Firefox which adds new, additional CSS statements to the pool of existing CSS statements.

This "normal" overwriting can be performed by appending an "!important" tag at the end.

But what if the original CSS contains already an "!important" tag?

How can I later/afterwards overwrite this with an even higher priority !important value?


Link to comment
Share on other sites

CSS is presentational it wouldn't affect file-size? To overwrite previous defined css properties using !important, you can use a greater parent ref element, class or id, of which the latter would give higher precedence when used with current selector.

Edited by dsonesuk
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...