Hello Phil,
the plugin doesn’t add !important to any rule. The plugin doesn’t modify at all the code you’re adding to the website. You are in full control of what shows up on your website.
As you already know, the CSS rules are applied in the order they are read by the browser. The !important directive is there in order to enforce the rule, even if it might be overwritten later by another rule.
A WordPress installation shows the CSS in the following order:
1. Theme’s and plugins’ external stylesheets (intermixed)
2. Other plugins’ internal CSS/JS and Simple Custom CSS and JS internal and external stylesheets (intermixed)
3. CSS codes added with the theme’s Customizer
Now, the answer to your question:
– If you want to overwrite CSS added in a theme’s or a plugin’s external stylesheet, then you don’t need !important.
– If you want to overwrite CSS added with the theme’s Customizer, you do need !important.
– If you want to overwrite an internal CSS added by another plugin, it depends on the order in which the WordPress installation executes each plugin, so you might need !important.
If you need to be reminded of the definitions for External, Internal and Inline CSS, here is a small tutorial.
-
This reply was modified 9 years, 3 months ago by
SilkyPress.
Hey Diana,
thanks a lot for the quick response – which is as perfect as your plugin. Benchmark!