Jump to content

Overwrite !important value by another !moreimportant value possible?


pstein

Recommended Posts

Assume I load a web page (from a web server where I have no access) and inspect CSS script files.

Some of the CSS rules contain values declared as "!important".

I want to overwrite a few of these values (after web page loading by my own user.js script) by other, customized values.

Since my values should have priority I am search for a way to declare them "!moreimportant".

How can I achieve this?

Peter

Edited by pstein
Link to comment
Share on other sites

Refer to parent id class element, it depends.

Original:

.mydiv {

color: lime !important;

}

Override examples:

body div.mydiv {

color: red !important;

}

#parentdiv div.mydiv {

color: yellow !important;

}

.parentdiv div.mydiv {

color: purple !important;

}

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...